Re: [ovs-dev] [PATCH v2 7/9] datapath: Add support for conntrack timeout policy

2019-08-06 Thread Justin Pettit


> On Aug 1, 2019, at 3:07 PM, Yi-Hung Wei  wrote:
> 
> This patch adds support for specifying a timeout policy for a
> connection in connection tracking system in kernel datapath.
> The timeout policy will be attached to a connection when the
> connection is committed to conntrack.
> 
> This patch introduces a new odp field OVS_CT_ATTR_TIMEOUT in the
> ct action that specifies the timeout policy in the datapath.
> In the following patch, during the upcall process, the vswitchd will use
> the ct_zone to look up the corresponding timeout policy and fill
> OVS_CT_ATTR_TIMEOUT if it is available.
> 
> The datapath code is from the following two net-next upstream commits.

I assume this is fine based on the upstream reviews.

--Justin


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 6/9] datapath: compat: Backport nf_conntrack_timeout support

2019-08-06 Thread Justin Pettit


> On Aug 1, 2019, at 3:07 PM, Yi-Hung Wei  wrote:
> 
> This patch brings in nf_ct_timeout_put() and nf_ct_set_timeout()
> when it is not available in the kernel.
> 
> Three symbols are created in acinclude.m4.
> 
> * HAVE_NF_CT_SET_TIMEOUT is used to determine if upstream net-next commit
> 717700d183d65 ("netfilter: Export nf_ct_{set,destroy}_timeout()") is
> availabe.  If it is defined, the kernel should have all the
> nf_conntrack_timeout support that OVS needs.
> 
> * HAVE_NF_CT_TIMEOUT is used to check if upstream net-next commit
> 6c1fd7dc489d9 ("netfilter: cttimeout: decouple timeout policy from
> nfnetlink_cttimeout object") is there.  If it is not defined, we
> will use the old ctnl_timeout interface rather than the nf_ct_timeout
> interface that is introduced in this commit.
> 
> * HAVE_NF_CT_TIMEOUT_FIND_GET_HOOK_NET is used to check if upstream
> commit 19576c9478682 ("netfilter: cttimeout: add netns support") is
> there, so that we pass different arguement based on whether the kernel
> has netns support.
> 
> Signed-off-by: Yi-Hung Wei 

Assuming you tested this on a few kernels, it seems reasonable to me.

--Justin


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 5/9] ofproto-dpif: Consume CT_Zone, and CT_Timeout_Policy tables

2019-08-06 Thread Justin Pettit


> On Aug 5, 2019, at 8:07 PM, Darrell Ball  wrote:
> 
> On Thu, Aug 1, 2019 at 3:10 PM Yi-Hung Wei  wrote:
> 
>> +struct ct_timeout_policy {
>> +struct uuid uuid;
>> +unsigned int last_used_seqno;
>> +struct ct_dpif_timeout_policy cdtp;
>> +struct cmap_node node;  /* Element in struct dpif_backer's
>> + * "ct_tps" cmap. */
>> 
> 
> 
> This looks like a layering violation
> should be in dpif-netlink or netlink-conntrack for kernel side

Hi, Darrell.  As I mentioned in my code review, I had my own concerns about 
layering, but mine were from the top-down.  Yi-Hung and I didn't understand 
your concern here, since these seem to be structures that would be useful 
regardless of the implementation.  Can you explain a bit more about your 
layering concerns?

Thanks,

--Justin


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 5/9] ofproto-dpif: Consume CT_Zone, and CT_Timeout_Policy tables

2019-08-06 Thread Justin Pettit


> On Aug 1, 2019, at 3:07 PM, Yi-Hung Wei  wrote:
> 
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index 751535249e21..6336494e0bc8 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> 
> +static struct ct_timeout_policy *
> +ct_timeout_policy_alloc(struct ovsrec_ct_timeout_policy *tp_cfg,
> +struct id_pool *tp_ids)

As we discussed this in person, bringing the OVSDB configuration into 
ofproto-dpif is a pretty different model than we've used before.  I think it 
would be better to abstract the config and carry it through the ofproto layer.  
As that will require a pretty significant restructuring of this patch, I'm 
going to give this a mostly cursory review.

> +{
> +struct ct_timeout_policy *tp;
> +size_t i;

This can be declared in a tighter scope.

> +static void
> +ct_timeout_policy_destroy(struct dpif_backer *backer,
> +  struct ct_timeout_policy *tp)
> +{
> +id_pool_free_id(backer->timeout_policy_ids, tp->cdtp.id);
> +ovsrcu_postpone(free, tp);
> +}

I don't think there's currently a way for this to happen, but I think it might 
be safer to make sure that this entry is no longer on the 'ct_tps' or 
'ct_tp_kill_list'  

> +static void
> +init_ct_zone_timeout_policy(struct dpif_backer *backer)

I think this function name would be clearer if policy were plural.

> +{
> ...
> +/* Remove existing timeout policy from datapath. */
> +struct ct_dpif_timeout_policy cdtp;
> +struct ct_timeout_policy *tp;

This can be declared in a tighter scope.

> +static void
> +destroy_ct_zone_timeout_policy(struct dpif_backer *backer)

I think this function name would be clearer if policy were plural.

> +{
> +struct ct_timeout_policy *tp;
> +struct ct_zone *zone;
> +
> +CMAP_FOR_EACH (zone, node, >ct_zones) {
> +ct_zone_remove_and_destroy(backer, zone);
> +}
> +
> +CMAP_FOR_EACH (tp, node, >ct_tps) {
> +cmap_remove(>ct_tps, >node, uuid_hash(>uuid));
> +ct_timeout_policy_destroy(backer, tp);
> +}
> +
> +cmap_destroy(>ct_zones);
> +cmap_destroy(>ct_tps);
> +id_pool_destroy(backer->timeout_policy_ids);
> +}

Don't we also need to free the items on 'ct_tp_kill_list'?

> +static void
> +ct_zone_timeout_policy_sweep(const struct ofproto *ofproto)
> +{
> +struct dpif_backer *backer = ofproto_dpif_cast(ofproto)->backer;
> +struct ct_timeout_policy *tp;
> +int err;
> +
> +if (!ovs_list_is_empty(>ct_tp_kill_list)) {
> +LIST_FOR_EACH (tp, list_node, >ct_tp_kill_list) {
> +err = ct_dpif_del_timeout_policy(backer->dpif, tp->cdtp.id);
> +if (!err) {
> +ovs_list_remove(>list_node);

Should this loop be using LIST_FOR_EACH_SAFE(), since it looks like it can be 
modified?

> +static void
> +ct_zone_timeout_policy_reconfig(const struct ofproto *ofproto,
> +const struct ovsrec_datapath *dp_cfg,
> +unsigned int idl_seqno)
> +{
> +struct dpif_backer *backer = ofproto_dpif_cast(ofproto)->backer;
> +struct ovsrec_ct_timeout_policy *tp_cfg;
> +struct ovsrec_ct_zone *zone_cfg;
> +struct ct_timeout_policy *tp;
> +struct ct_zone *zone;
> +uint16_t zone_id;
> +bool new_zone;
> +size_t i;

Almost all of these can be declared in a tighter scope.

> diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
> index 7907d4bfb416..41e07f0ee23e 100644
> --- a/ofproto/ofproto-provider.h
> +++ b/ofproto/ofproto-provider.h
> 
> @@ -1872,6 +1873,13 @@ struct ofproto_class {
> /* Flushes the connection tracking tables. If 'zone' is not NULL,
>  * only deletes connections in '*zone'. */
> void (*ct_flush)(const struct ofproto *, const uint16_t *zone);
> +
> +/* Reconfigures the zone-based conntrack tiemout policy based on the

s/tiemout/timeout/

> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 2976771aeaba..39b7de7d8182 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> 
> static void
> +reconfigure_conntrack_timeout_policy(const struct ovsrec_open_vswitch *cfg)

This function uses "conntrack" in the name and others use "ct".  It would be 
nice to be consistent.  I would lean towards "ct", since it's shorter and used 
elsewhere in the code.

As I mentioned, I'll do a more thorough review of v3.

Thanks,

--Justin


-=-=-=-=-=-=-=-=-=-


diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 6336494e0bc8..7a7d72c89440 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -169,7 +169,7 @@ struct ct_timeout_policy {
 struct ct_zone {
 uint16_t id;
 unsigned int last_used_seqno;
-struct uuid tp_uuid;/* uuid that identifies a timeout policy in
+struct uuid tp_uuid;/* UUID that identifies a timeout policy in
  * struct dpif_backer's "ct_tps"  cmap. */
 struct cmap_node node;  

[ovs-dev] [PATCH] datapath: Apply bug fixes of nf_conncount for different kernel versions

2019-08-06 Thread Yifeng Sun
In upstream kernel, there are several critical bug fixes for nf_conncount
between 5c789e1 ("netfilter: nf_conncount: Add list lock and gc worker,
and RCU for init tree search") and c78e781 ("netfilter: nf_conncount:
replace CONNCOUNT_LOCK_SLOTS with CONNCOUNT_SLOTS"). This fixes are
already backported to OVS datapath.

This patch helps OVS datapath to always choose bug-fixed nf_conncount code.
If kernel already has these fixes, then kernel's nf_conncount is being used.
Otherwise, OVS falls back to use compat nf_conncount functions.

This patch is suggested by YiHung Wei.

Signed-off-by: Yifeng Sun 
---
 acinclude.m4 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index f8e856d3303f..f0e38898b17a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -713,7 +713,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_nat.h], [nf_nat_range2])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_seqadj.h], 
[nf_ct_seq_adjust])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_count.h], 
[nf_conncount_gc_list],
-  [OVS_DEFINE([HAVE_UPSTREAM_NF_CONNCOUNT])])
+  
[OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_count.h],
+   [int nf_conncount_add],
+   [], 
[OVS_DEFINE([HAVE_UPSTREAM_NF_CONNCOUNT])])])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32])
   OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32_max])
-- 
2.7.4

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] datapath: compat: Backports bugfixes for nf_conncount

2019-08-06 Thread Yifeng Sun
This patch backports several critical bug fixes related to
locking and data consistency in nf_conncount code.

This backport is based on the following upstream net-next upstream commits.
4cd273b ("netfilter: nf_conncount: don't skip eviction when age is negative")
d4e7df1 ("netfilter: nf_conncount: use rb_link_node_rcu() instead of 
rb_link_node()")
53ca0f2 ("netfilter: nf_conncount: remove wrong condition check routine")
3c5cdb1 ("netfilter: nf_conncount: fix unexpected permanent node of list.")
31568ec ("netfilter: nf_conncount: fix list_del corruption in conn_free")
fd3e71a ("netfilter: nf_conncount: use spin_lock_bh instead of spin_lock")

This patch also added additional compat code so that it can build on
all supported kernel versions.

Travis tests are at
https://travis-ci.org/yifsun/ovs-travis/builds/568603796

VMware-BZ: #2396471

CC: Taehee Yoo 
Signed-off-by: Yifeng Sun 
---
v1->v2: Add fixes to support old kernel versions. Thanks YiHung for reviewing.

 acinclude.m4 |  2 ++
 datapath/linux/Modules.mk|  3 +-
 datapath/linux/compat/include/linux/rbtree.h | 19 
 datapath/linux/compat/nf_conncount.c | 46 ++--
 4 files changed, 52 insertions(+), 18 deletions(-)
 create mode 100644 datapath/linux/compat/include/linux/rbtree.h

diff --git a/acinclude.m4 b/acinclude.m4
index 116ffcf9096d..f8e856d3303f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1012,6 +1012,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   [OVS_DEFINE([HAVE_GRE_CALC_HLEN])])
   OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [ip_gre_calc_hlen],
   [OVS_DEFINE([HAVE_IP_GRE_CALC_HLEN])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/rbtree.h], [rb_link_node_rcu],
+  [OVS_DEFINE([HAVE_RBTREE_RB_LINK_NODE_RCU])])
 
   if cmp -s datapath/linux/kcompat.h.new \
 datapath/linux/kcompat.h >/dev/null 2>&1; then
diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk
index cbb29f1c69d0..69d7faeac414 100644
--- a/datapath/linux/Modules.mk
+++ b/datapath/linux/Modules.mk
@@ -116,5 +116,6 @@ openvswitch_headers += \
linux/compat/include/uapi/linux/netfilter.h \
linux/compat/include/linux/mm.h \
linux/compat/include/linux/netfilter.h \
-   linux/compat/include/linux/overflow.h
+   linux/compat/include/linux/overflow.h \
+   linux/compat/include/linux/rbtree.h
 EXTRA_DIST += linux/compat/build-aux/export-check-whitelist
diff --git a/datapath/linux/compat/include/linux/rbtree.h 
b/datapath/linux/compat/include/linux/rbtree.h
new file mode 100644
index ..dbf20ff0e0b8
--- /dev/null
+++ b/datapath/linux/compat/include/linux/rbtree.h
@@ -0,0 +1,19 @@
+#ifndef __LINUX_RBTREE_WRAPPER_H
+#define __LINUX_RBTREE_WRAPPER_H 1
+
+#include_next 
+
+#ifndef HAVE_RBTREE_RB_LINK_NODE_RCU
+#include 
+
+static inline void rb_link_node_rcu(struct rb_node *node, struct rb_node 
*parent,
+   struct rb_node **rb_link)
+{
+   node->__rb_parent_color = (unsigned long)parent;
+   node->rb_left = node->rb_right = NULL;
+
+   rcu_assign_pointer(*rb_link, node);
+}
+#endif
+
+#endif /* __LINUX_RBTREE_WRAPPER_H */
diff --git a/datapath/linux/compat/nf_conncount.c 
b/datapath/linux/compat/nf_conncount.c
index eeae440f872d..6a4d058e7fac 100644
--- a/datapath/linux/compat/nf_conncount.c
+++ b/datapath/linux/compat/nf_conncount.c
@@ -54,6 +54,7 @@ struct nf_conncount_tuple {
struct nf_conntrack_zonezone;
int cpu;
u32 jiffies32;
+   booldead;
struct rcu_head rcu_head;
 };
 
@@ -111,15 +112,16 @@ nf_conncount_add(struct nf_conncount_list *list,
conn->zone = *zone;
conn->cpu = raw_smp_processor_id();
conn->jiffies32 = (u32)jiffies;
-   spin_lock(>list_lock);
+   conn->dead = false;
+   spin_lock_bh(>list_lock);
if (list->dead == true) {
kmem_cache_free(conncount_conn_cachep, conn);
-   spin_unlock(>list_lock);
+   spin_unlock_bh(>list_lock);
return NF_CONNCOUNT_SKIP;
}
list_add_tail(>node, >head);
list->count++;
-   spin_unlock(>list_lock);
+   spin_unlock_bh(>list_lock);
return NF_CONNCOUNT_ADDED;
 }
 
@@ -136,19 +138,22 @@ static bool conn_free(struct nf_conncount_list *list,
 {
bool free_entry = false;
 
-   spin_lock(>list_lock);
+   spin_lock_bh(>list_lock);
 
-   if (list->count == 0) {
-   spin_unlock(>list_lock);
+   if (conn->dead) {
+   spin_unlock_bh(>list_lock);
return free_entry;
}
 
list->count--;
+   conn->dead = true;
list_del_rcu(>node);
-   if (list->count == 0)
+   if (list->count == 0) {
+   list->dead = true;

[ovs-dev] OVN: Guest VLAN Tagging proposal

2019-08-06 Thread Ankur Sharma
Hi,

PROBLEM STATEMENT:
===
OVN does not provide support for guest vlan tagging, i.e where a VIF can vlan 
tag the packets.
 a. This feature can also be addressed as Trunking support as well 
(from logical switch port perspective).
 b. Main use case would be scenarios like Nested hypervisors.

PROPOSAL:
==
Leverage on the "container inside VM" support that OVN has already.
i.e following will be done:

a. For each "allowed" tagged vlan we will create a logical switch port and add 
it to the corresponding (based on allowed vlan id) logical switch.

b. These logical switch ports share the same openflow port (the one to which VM 
is attached), and hence will have the VMs vif id as parent port.

c. For a packet coming from the VM, both OVS port id and tagged packet's vlan 
id will be used to determine packet's logical switch pipeline and corresponding 
logical ingress port.
This will happen at OVS table=0.

d. Packet passes through rest of logical switch pipeline, like any regular 
packet.

e. Similarly, same packet can pass through logical router pipeline like a 
regular packet.

f. During egress in table=65, vlan header is added back and packet is directed 
to openflow port corresponding to logical egress port's parent.

https://docs.google.com/document/d/1SH0DaDGMi_Dknp0C5v4OvDNrZMAGIufylDTyQ7OPt9c/edit?usp=sharing
[https://lh4.googleusercontent.com/KlSQErZyrqSgL_iyiiKX3FUhot5q3c7tMA6_ZSzPDh8pKtmjQERu16wstoM8f7lPP9uvcA=w1200-h630-p]
GUEST VLAN TAGGING/TRUNKING SUPPORT IN 
OVN
GUEST VLAN TAGGING/TRUNKING SUPPORT IN OVN Drawings 1 Figure 1 1 Figure 2 2 
Drawings Figure 1 Figure 2 \u000B Read vlan id from packet and do following: 
set metadata to corresponding logical switch pipeline. Strip vlan header. 
Packet enters logical router pipeline. Routed packet ent...
docs.google.com

All the steps mentioned above are exactly what OVN does for containers inside 
VM scenario.


CODE CHANGES NEEDED:
==
a. No code changes needed for packet flow mentioned above.
b. Documentation.
c. Unit tests/ovn-nbctl CLIs specific to guest vlan tagging/trunking.


LIMITATIONS:
===
a. Main limitation is that it would more work for CMS.
b. i.e for each allowed vlan id, CMS will have to create LSP on corresponding 
logical switch and mark the VIF port as parent.
c. Deployments where there are multiple logical switches with same vlan id, CMS 
would have to take LS name as input from the user.

BENEFITS:
=
Main benefit is that logical router can be used without requiring any 
changes/workarounds to its pipeline.



Please let me concerns/feedback on the proposal.

Thanks

Regards,
Ankur
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] ФИЗИКА - увлекательная видеоколлекция для детей. 13_05_2019 02_03 198707

2019-08-06 Thread Роман Колунов via dev
ФИЗИКА
Увлекательная видеоколлекция для детей.

Почему Земля имеет форму шара? Существует ли вечный двигатель? Можно ли самому 
изготовить лупу? Где можно услышать эхо и с какой скоростью движется звук? Как 
образуется радуга? почему не падает самолет и не тонет корабль? Почему 
космонавты не чувствуют веса собственного тела? Оказывается, всё загадочное 
легко объяснимо — надо только выучить основные законы физики, тем более что они 
довольно просты. В этом совершенно уверен профессор Даниил Эдисонович Кварк, и 
на каждом уроке занимательной физики он убеждает в этом своих юных зрителей и 
корреспондентов. Влюблённый в свою замечательную науку, он готов рассказывать о 
ней до тех пор, пока найдётся хоть один слушатель. А их становится всё больше и 
больше — ведь профессор не читает лекций, а рассказывает ребятам о тех 
явлениях, с которыми столкнулись они сами, но не смогли понять. Рассчитана на 
возраст 5-10 лет.

! Список серий и описание вы можете увидеть в прикреплённом к письму файле !

Коллекция состоит из 65 серий. Записана на внешний USB накопитель (флешка). 
Проблем с воспроизведением не возникнет, можно смотреть на компьютере, 
планшете, смартфоне, телевизоре и т.д. Запись на внешний USB накопитель имеет 
ряд преимуществ в сравнении с обычными DVD дисками, USB накопитель гораздо 
легче, занимает меньше места, обладает высокой надёжностью сохранности записей, 
а это значит, что наша коллекция будет радовать Вас много лет. Мы гарантируем 
отличное качество всех записей. На самом носителе создана продуманная 
структура, все записи разнесены по каталогам, имеются плейлисты, прописаны 
теги, а также полный список вошедших записей, поэтому проблем с поиском и 
навигацией не возникнет.

Стоимость коллекции на внешнем USB накопителе — 6500 (Шесть Тысяч Пятьсот) 
Рублей. 
Продаются только вместе. Доставка включена в стоимость.

Доставка и оплата коллекции осуществляется только по России — почтой, 
наложенным платежом, никакой предоплаты не требуется, оплата только в момент 
получения на почте, доставка включена в стоимость. Сроки доставки зависят от 
расстояния и степени загрузки почты, но как правило это 7-14 суток с момента 
отправки. Напоминаем, что у нас нет курьерской доставки — только почтой, в том 
числе и по Москве.

Для оформления заказа просьба не забывать указывать:
 --- Ваш почтовый индекс (пишите правильный индекс — это ускорит доставку);
 --- Ваш город и точный адрес (название улицы, номер дома и номер квартиры);
 --- Ф.И.О. получателя и ОБЯЗАТЕЛЬНО номер контактного телефона (лучше сотовый);
Заказы\вопросы направляйте по адресу: fiz...@cwhflash.ru

Мы очень ответственно относимся к качеству нашего товара, поэтому перед 
отправкой всё дополнительно проверяется, как следствие отправка бракованной 
продукции сведена к нулю. Товар упаковывается в специальный ударостойкий 
материал, что в значительной степени уменьшает риск повреждения при 
транспортировке. Если вдруг с полученным товаром возникнут проблемы, то все 
наши покупатели всегда могут рассчитывать на квалифицированную техническую 
поддержку. Мы никогда не отказываемся от гарантийных обязательств, в случае 
проблемы Вы можете рассчитывать на замену, почтовые расходы мы берём на себя.

По вашему желанию, данная коллекция может быть записана на DVD диски. Для 
записи используются надёжные DVD диски со специальным покрытием, которое 
повышает устойчивость диска к механическим повреждениям, таким как трещины и 
царапины, а это значит, что наша коллекция будет радовать Вас много лет. 
Коллекция упакована в пластиковые боксы (slim-dvd), имеет красивые и 
продуманные обложки, с обратной стороны которых указан список вошедших на 
каждый диск серий и другая полезная информация, поэтому проблем с поиском и 
навигацией не возникнет. Если хотите приобрести коллекцию, записанную на DVD 
дисках, то в этом случае просьба сообщить нам об этом в своей заявке, цена 
прежняя, как у версии на внешнем USB накопителе (флешка) — 6500 (Шесть Тысяч 
Пятьсот) Рублей.

Ещё в наличии имеется аналогичная видеоколлекция по Химии состоит из 82 серий. 
Записана на флешку. Стоимость коллекции на внешнем USB накопителе — 6500 (Шесть 
Тысяч Пятьсот) Рублей.

Если вы не хотите больше получать от нас письма, отправьте нам письмо с темой 
“deletemail” и Ваш адрес навсегда будет удален автоматически.

13_05_2019 02_03 198707

ovs-dev@openvswitch.org
1 ñåðèÿ. Íàóêà ôèçèêà. Íàó÷íûå îòêðûòèÿ.
×òî òàêîå ôèçèêà, ÷òî èçó÷àåò ýòà íàóêà? Íàó÷íûå îòêðûòèÿ. Ñîëíå÷íîå çàòìåíèå. 
Âñåëåííàÿ. Ãàëàêòèêè. Òåîðèÿ àòîìíîãî ñòðîåíèÿ âåùåñòâà. Âîïðîñ î âå÷íîì 
äâèãàòåëå.

2 ñåðèÿ. Çåðêàëî.
Çåðêàëî. Çàêîíû îòðàæåíèÿ. Ëó÷ ñâåòà. Èñêàæåíèå. Ôîêóñû ñ çåðêàëîì.

3 ñåðèÿ. Ñâåò.
Ëó÷ ñâåòà è åãî ïðåëîìëåíèå. Ïðèíöèï ëóïû. Ãëàç è ëèíçà. Êèíîïðîåêòîð. Ðàäóãà.

4 ñåðèÿ. Çâóê. 1 ÷àñòü.
Ïîíÿòèå çâóêà. Åäèíèöû èçìåðåíèÿ çâóêà. Çâóêîâûå âîëíû. Óëüòðàçâóê. Ñòðîåíèå 
÷åëîâå÷åñêîãî óõà.

5 ñåðèÿ. Çâóê. 2 ÷àñòü.
Ýõî. Ñêîðîñòü çâóêà. Ãðîì.

6 ñåðèÿ. Çàêîí çåìíîãî ïðèòÿæåíèÿ. Ãðàâèòàöèÿ.
Çàêîí òÿãîòåíèÿ. Ïî÷åìó 

[ovs-dev] [RFC ovn] Modify release document for OVN.

2019-08-06 Thread Mark Michelson
This is an RFC to discuss the modified release cycle of OVN compared to
OVS. The document is mostly unchanged, with two exceptions:

* The release cycle for OVN is modified to be 3 months instead of 6.
* The version numbering for OVN is modified to use the year and month of
  the release instead of other numbers.

Signed-off-by: Mark Michelson 
---
All changes in this document are negotiable :)

OVN features are consumed more directly by CMSes than OVS changes, so
OVN has a case for releasing more frequently than OVS. I came up with a
three month cycle, but we could alter this if desired.

The version numbering change is based on trying not to cause confusion
about compatibility between OVS and OVN versions. If we continue with
the 2.X scheme, then users may assume that matching version numbers of
OVS and OVN are required when they aren't. They may also assume
compatibility between like version numbers when that may not be true.
Using the . version scheme makes it clear that the version
numbers are completely separate from OVS's versioning. It encourages
users to look up version compatibility instead of assuming something.
It also makes it clear when a painfully out of date version is being
used.

One thing I did not touch in this document was the LTS section. I'll be
honest, I had no idea that OVS even had LTSes until I modified the
document just now. If we want to shorten the time period between LTSes
(or not have LTSes at all), then we can discuss that.
---
 Documentation/internals/release-process.rst | 70 ++---
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/Documentation/internals/release-process.rst 
b/Documentation/internals/release-process.rst
index 89c117724..4009da555 100644
--- a/Documentation/internals/release-process.rst
+++ b/Documentation/internals/release-process.rst
@@ -21,23 +21,23 @@
 
   Avoid deeper levels because they do not render well.
 
-
-Open vSwitch Release Process
-
+===
+OVN Release Process
+===
 
-This document describes the process ordinarily used for Open vSwitch
-development and release.  Exceptions are sometimes necessary, so all of the
-statements here should be taken as subject to change through rough consensus of
-Open vSwitch contributors, obtained through public discussion on, e.g., ovs-dev
-or the #openvswitch IRC channel.
+This document describes the process ordinarily used for OVN development and
+release.  Exceptions are sometimes necessary, so all of the statements here
+should be taken as subject to change through rough consensus of OVN
+contributors, obtained through public discussion on, e.g., ovs-dev or the
+#openvswitch IRC channel.
 
 Release Strategy
 
 
-Open vSwitch feature development takes place on the "master" branch.
-Ordinarily, new features are rebased against master and applied directly.  For
-features that take significant development, sometimes it is more appropriate to
-merge a separate branch into master; please discuss this on ovs-dev in advance.
+OVN feature development takes place on the "master" branch. Ordinarily, new
+features are rebased against master and applied directly.  For features that
+take significant development, sometimes it is more appropriate to merge a
+separate branch into master; please discuss this on ovs-dev in advance.
 
 The process of making a release has the following stages.  See `Release
 Scheduling`_ for the timing of each stage:
@@ -50,7 +50,7 @@ Scheduling`_ for the timing of each stage:
Please propose and discuss exceptions on ovs-dev.
  
 2. Fork a release branch from master, named for the expected release number,
-   e.g. "branch-2.3" for the branch that will yield Open vSwitch 2.3.x.
+   e.g. "branch-2019.10" for the branch that will yield OVN 2019.10.x.
 
Release branches are intended for testing and stabilization.  At this stage
and in later stages, they should receive only bug fixes, not new features.
@@ -65,19 +65,19 @@ Scheduling`_ for the timing of each stage:
and risk and discussed on ovs-dev before creating the branch.
 
 3. When committers come to rough consensus that the release is ready, they
-   release the .0 release on its branch, e.g. 2.3.0 for branch-2.3.  To make
-   the actual release, a committer pushes a signed tag named, e.g. v2.3.0, to
-   the Open vSwitch repository, makes a release tarball available on
+   release the .0 release on its branch, e.g. 2019.10.0 for branch-2019.10.  To
+   make the actual release, a committer pushes a signed tag named, e.g.
+   v2019.10.0, to the OVN repository, makes a release tarball available on
openvswitch.org, and posts a release announcement to ovs-announce.
 
 4. As bug fixes accumulate, or after important bugs or vulnerabilities are
-   fixed, committers may make additional releases from a branch: 2.3.1, 2.3.2,
-   and so on.  The process is the same for these additional 

[ovs-dev] [PATCH] datapath: compat: Backports bugfixes for nf_conncount

2019-08-06 Thread Yifeng Sun
This patch backports several critical bug fixes related to
locking and data consistency in nf_conncount code.

This backport is based on the following upstream net-next upstream commits.
d4e7df1 ("netfilter: nf_conncount: use rb_link_node_rcu() instead of 
rb_link_node()")
53ca0f2 ("netfilter: nf_conncount: remove wrong condition check routine")
3c5cdb1 ("netfilter: nf_conncount: fix unexpected permanent node of list.")
31568ec ("netfilter: nf_conncount: fix list_del corruption in conn_free")
fd3e71a ("netfilter: nf_conncount: use spin_lock_bh instead of spin_lock")

VMware-BZ: #2396471

CC: Taehee Yoo 
Signed-off-by: Yifeng Sun 
---
 datapath/linux/compat/nf_conncount.c | 54 ++--
 1 file changed, 33 insertions(+), 21 deletions(-)

diff --git a/datapath/linux/compat/nf_conncount.c 
b/datapath/linux/compat/nf_conncount.c
index eeae440f872d..6e4f368b9389 100644
--- a/datapath/linux/compat/nf_conncount.c
+++ b/datapath/linux/compat/nf_conncount.c
@@ -49,12 +49,13 @@
 
 /* we will save the tuples of all connections we care about */
 struct nf_conncount_tuple {
-   struct list_headnode;
+   struct list_headnode;
struct nf_conntrack_tuple   tuple;
struct nf_conntrack_zonezone;
-   int cpu;
-   u32 jiffies32;
-   struct rcu_head rcu_head;
+   int cpu;
+   u32 jiffies32;
+   booldead;
+   struct rcu_head rcu_head;
 };
 
 struct nf_conncount_rb {
@@ -111,15 +112,16 @@ nf_conncount_add(struct nf_conncount_list *list,
conn->zone = *zone;
conn->cpu = raw_smp_processor_id();
conn->jiffies32 = (u32)jiffies;
-   spin_lock(>list_lock);
+   conn->dead = false;
+   spin_lock_bh(>list_lock);
if (list->dead == true) {
kmem_cache_free(conncount_conn_cachep, conn);
-   spin_unlock(>list_lock);
+   spin_unlock_bh(>list_lock);
return NF_CONNCOUNT_SKIP;
}
list_add_tail(>node, >head);
list->count++;
-   spin_unlock(>list_lock);
+   spin_unlock_bh(>list_lock);
return NF_CONNCOUNT_ADDED;
 }
 
@@ -136,19 +138,22 @@ static bool conn_free(struct nf_conncount_list *list,
 {
bool free_entry = false;
 
-   spin_lock(>list_lock);
+   spin_lock_bh(>list_lock);
 
-   if (list->count == 0) {
-   spin_unlock(>list_lock);
+   if (conn->dead) {
+   spin_unlock_bh(>list_lock);
return free_entry;
}
 
list->count--;
+   conn->dead = true;
list_del_rcu(>node);
-   if (list->count == 0)
+   if (list->count == 0) {
+   list->dead = true;
free_entry = true;
+   }
 
-   spin_unlock(>list_lock);
+   spin_unlock_bh(>list_lock);
call_rcu(>rcu_head, __conn_free);
return free_entry;
 }
@@ -160,7 +165,7 @@ find_or_evict(struct net *net, struct nf_conncount_list 
*list,
const struct nf_conntrack_tuple_hash *found;
unsigned long a, b;
int cpu = raw_smp_processor_id();
-   __s32 age;
+   u32 age;
 
found = nf_conntrack_find_get(net, >zone, >tuple);
if (found)
@@ -248,7 +253,7 @@ static void nf_conncount_list_init(struct nf_conncount_list 
*list)
 {
spin_lock_init(>list_lock);
INIT_LIST_HEAD(>head);
-   list->count = 1;
+   list->count = 0;
list->dead = false;
 }
 
@@ -261,6 +266,7 @@ static bool nf_conncount_gc_list(struct net *net,
struct nf_conn *found_ct;
unsigned int collected = 0;
bool free_entry = false;
+   bool ret = false;
 
list_for_each_entry_safe(conn, conn_n, >head, node) {
found = find_or_evict(net, list, conn, _entry);
@@ -290,7 +296,15 @@ static bool nf_conncount_gc_list(struct net *net,
if (collected > CONNCOUNT_GC_MAX_NODES)
return false;
}
-   return false;
+
+   spin_lock_bh(>list_lock);
+   if (!list->count) {
+   list->dead = true;
+   ret = true;
+   }
+   spin_unlock_bh(>list_lock);
+
+   return ret;
 }
 
 static void __tree_nodes_free(struct rcu_head *h)
@@ -310,11 +324,8 @@ static void tree_nodes_free(struct rb_root *root,
while (gc_count) {
rbconn = gc_nodes[--gc_count];
spin_lock(>list.list_lock);
-   if (rbconn->list.count == 0 && rbconn->list.dead == false) {
-   rbconn->list.dead = true;
-   rb_erase(>node, root);
-   call_rcu(>rcu_head, __tree_nodes_free);
-   }
+   rb_erase(>node, root);
+   

Re: [ovs-dev] OVN Mailing list and patch submission

2019-08-06 Thread Mark Michelson

On 7/30/19 2:08 PM, Mark Michelson wrote:

Hi,

Now that the OVN repo is created and new OVN changes are being targeted 
for it, it seems like a good idea to bring up the topic of creating a 
mailing list for OVN again. Would it be possible to get a new OVN 
mailing list?


A subject that goes hand-in-hand with a new mailing list is patch 
submission for OVN. We can continue to use e-mail like we have with OVS, 
we could use github pull requests, or we could be permissive and allow 
for either (my preference). What are people's thoughts here? For e-mail 
patch submissions, it would be swell if we could have 0-day robot work 
for the OVN project the same as it does for OVS. What would we need to 
do to ensure that this is possible?


Thanks,
Mark Michelson


Bumping this. Is there anything preventing an OVN mailing list from 
being set up? Is there anything that I or anyone else can do to assist?


Thanks.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 9/9] system-traffic: Add zone-based conntrack timeout policy test

2019-08-06 Thread Darrell Ball
On Tue, Aug 6, 2019 at 11:07 AM Yi-Hung Wei  wrote:

> On Tue, Aug 6, 2019 at 10:21 AM Darrell Ball  wrote:
> >
> >
> > I did some more testing and found a similar problem as in V1.
> >
> > This test can be run successfully once and then fails after that.
> > Maybe you want to look into that. It is probably related to:
> >
> > dball@ubuntu:~/openvswitch/ovs$ lsmod | grep nf
> > .
> > nfnetlink_cttimeout16384  1
> > .
> >
> > Darrell
> >
>
> Thanks for trying out the test.  I can not reproduce the issue that
> you mentioned on my local VM.
>
> Can you provide your kernel version and system-kmod-testsuite.log?
>
> Thanks,
>
> -Yi-Hung
>


Here it is:

dball@ubuntu:~/ovs$ uname -a
Linux ubuntu 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018
x86_64 x86_64 x86_64 GNU/Linux

dball@ubuntu:~/ovs$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

# -*- compilation -*-
75. system-traffic.at:3182: testing conntrack - zone-based timeout policy
...
net.netfilter.nf_conntrack_helper = 0
../../tests/system-traffic.at:3185: modprobe openvswitch
../../tests/system-traffic.at:3185: ovsdb-tool create conf.db
$abs_top_srcdir/vswitchd/vswitch.ovsschema
../../tests/system-traffic.at:3185: ovsdb-server --detach --no-chdir
--pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock
stderr:
2019-08-06T19:11:47Z|1|vlog|INFO|opened log file
/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/075/ovsdb-server.log
../../tests/system-traffic.at:3185: sed < stderr '
/vlog|INFO|opened log file/d
/ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d'
../../tests/system-traffic.at:3185: ovs-vsctl --no-wait init
../../tests/system-traffic.at:3185: ovs-vswitchd  --detach --no-chdir
--pidfile --log-file -vvconn -vofproto_dpif -vunixctl
stderr:
2019-08-06T19:11:47Z|1|vlog|INFO|opened log file
/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/075/ovs-vswitchd.log
2019-08-06T19:11:47Z|2|ovs_numa|INFO|Discovered 1 CPU cores on NUMA
node 0
2019-08-06T19:11:47Z|3|ovs_numa|INFO|Discovered 1 NUMA nodes and 1 CPU
cores
2019-08-06T19:11:47Z|4|reconnect|INFO|unix:/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/075/db.sock:
connecting...
2019-08-06T19:11:47Z|5|reconnect|INFO|unix:/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/075/db.sock:
connected
../../tests/system-traffic.at:3185: sed < stderr '
/ovs_numa|INFO|Discovered /d
/vlog|INFO|opened log file/d
/vswitchd|INFO|ovs-vswitchd (Open vSwitch)/d
/reconnect|INFO|/d
/dpif_netlink|INFO|Generic Netlink family .ovs_datapath. does not exist/d
/ofproto|INFO|using datapath ID/d
/netdev_linux|INFO|.*device has unknown hardware address family/d
/ofproto|INFO|datapath ID changed to fedcba9876543210/d
/dpdk|INFO|DPDK Disabled - Use other_config:dpdk-init to enable/d
/netlink_socket|INFO|netlink: could not enable listening to all nsid/d
/probe tc:/d
/tc: Using policy/d'
../../tests/system-traffic.at:3185: ovs-vsctl -- add-br br0 -- set Bridge
br0
protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15
fail-mode=secure  --
--- /dev/null 2019-02-26 18:50:08.04306 -0800
+++
/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/at-groups/75/stderr
2019-08-06 12:12:17.489401899 -0700
@@ -0,0 +1,2 @@
+2019-08-06T19:12:17Z|2|fatal_signal|WARN|terminating with signal 14
(Alarm clock)
+/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/at-groups/75/test-source:
line 874: 58958 Alarm clock ovs-vsctl -- add-br br0 -- set
Bridge br0
protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15
fail-mode=secure --
../../tests/system-traffic.at:3185: exit code was 142, expected 0
ovsdb-server.log:
> 2019-08-06T19:11:47.418Z|1|vlog|INFO|opened log file
/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/075/ovsdb-server.log
> 2019-08-06T19:11:47.420Z|2|ovsdb_server|INFO|ovsdb-server (Open
vSwitch) 2.12.90
> 2019-08-06T19:11:57.433Z|3|memory|INFO|4504 kB peak resident set size
after 10.0 seconds
> 2019-08-06T19:11:57.433Z|4|memory|INFO|cells:122 monitors:3 sessions:2
ovs-vswitchd.log:
> 2019-08-06T19:11:47.449Z|1|vlog|INFO|opened log file
/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/075/ovs-vswitchd.log
> 2019-08-06T19:11:47.449Z|2|ovs_numa|INFO|Discovered 1 CPU cores on
NUMA node 0
> 2019-08-06T19:11:47.449Z|3|ovs_numa|INFO|Discovered 1 NUMA nodes and
1 CPU cores
>
2019-08-06T19:11:47.450Z|4|reconnect|INFO|unix:/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/075/db.sock:
connecting...
>
2019-08-06T19:11:47.450Z|5|reconnect|INFO|unix:/home/dball/ovs/_gcc/tests/system-kmod-testsuite.dir/075/db.sock:
connected
> 2019-08-06T19:11:47.473Z|6|bridge|INFO|ovs-vswitchd (Open vSwitch)
2.12.90
> 2019-08-06T19:11:47.492Z|7|ofproto_dpif|INFO|system@ovs-system:
Datapath supports recirculation
> 2019-08-06T19:11:47.492Z|8|ofproto_dpif|INFO|system@ovs-system: VLAN
header 

[ovs-dev] [RFC ovn] Document process for compatibility between OVS and OVN.

2019-08-06 Thread Mark Michelson
This document serves to provide an explanation for how OVN will remain
compatible with OVS. It provides instructions for OVN contributors for
how to maintain compatibility even across older versions of OVS when
possible.

Note that the document currently makes reference to some non-existent
items. For instance, it refers to an ovs-compat directory in the OVN
project. Also, it refers to some macros for testing the OVS version.
These will be added in a future commit if the process documented here is
approved.

I'm submitting this as an RFC, since I imagine there are some details I
have not thought about, and there will also be some great suggestions
from others on this matter.

Signed-off-by: Mark Michelson 
---
 Documentation/automake.mk  |   1 +
 Documentation/internals/contributing/index.rst |   1 +
 .../contributing/ovs-ovn-compatibility.rst | 165 +
 3 files changed, 167 insertions(+)
 create mode 100644 
Documentation/internals/contributing/ovs-ovn-compatibility.rst

diff --git a/Documentation/automake.mk b/Documentation/automake.mk
index f7e1d2628..d9bd4be1f 100644
--- a/Documentation/automake.mk
+++ b/Documentation/automake.mk
@@ -56,6 +56,7 @@ DOC_SOURCE = \
Documentation/internals/contributing/documentation-style.rst \
Documentation/internals/contributing/libopenvswitch-abi.rst \
Documentation/internals/contributing/submitting-patches.rst \
+   Documentation/internals/contributing/ovs-ovn-compatibility.rst \
Documentation/requirements.txt \
$(addprefix Documentation/ref/,$(RST_MANPAGES) $(RST_MANPAGES_NOINST))
 FLAKE8_PYFILES += Documentation/conf.py
diff --git a/Documentation/internals/contributing/index.rst 
b/Documentation/internals/contributing/index.rst
index a46cb046a..7ef57a1e2 100644
--- a/Documentation/internals/contributing/index.rst
+++ b/Documentation/internals/contributing/index.rst
@@ -36,3 +36,4 @@ The below guides provide information on contributing to Open 
vSwitch itself.
coding-style-windows
documentation-style
libopenvswitch-abi
+   ovs-ovn-compatibility
diff --git a/Documentation/internals/contributing/ovs-ovn-compatibility.rst 
b/Documentation/internals/contributing/ovs-ovn-compatibility.rst
new file mode 100644
index 0..4f8ea754a
--- /dev/null
+++ b/Documentation/internals/contributing/ovs-ovn-compatibility.rst
@@ -0,0 +1,165 @@
+..
+  Copyright (c) 2019 Nicira, Inc.
+
+  Licensed under the Apache License, Version 2.0 (the "License"); you may
+  not use this file except in compliance with the License. You may obtain
+  a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+  License for the specific language governing permissions and limitations
+  under the License.
+
+  Convention for heading levels in Open vSwitch documentation:
+
+  ===  Heading 0 (reserved for the title in a document)
+  ---  Heading 1
+  ~~~  Heading 2
+  +++  Heading 3
+  '''  Heading 4
+
+  Avoid deeper levels because they do not render well.
+
+===
+Keeping OVN Compatible with OVS
+===
+
+OVN has split from OVS. Prior to this split, there was no issue with
+compatibility. All code changes happened at the same time and in the same repo.
+New releases contained the latest OVS and OVN changes. But now these 
assumptions
+are no longer valid, and so care must be taken to maintain compatibility.
+
+OVS and OVN versions
+
+
+Prior to the split, the release schedule for OVN was bound to the release
+schedule for OVS. OVS releases a new version approximately every 6 months. OVN
+has not yet determined a release schedule, but it is entirely possible that it
+will be different from OVS. Eventually, this will lead to a situation where it
+is very important that we publish which versions of OVN are compatible with
+which versions of OVS. When incompatibilities are discovered, it is important 
to
+ensure that these are clearly stated.
+
+The split of OVS and OVN happened in the run-up to the release of OVS 2.12. As 
a
+result, all versions of OVN *must* be compiled against OVS version 2.12 or
+later. Before going further into compatibility, let's explore the ways that OVN
+and OVS can become incompatible.
+
+Compile-time Incompatibility
+
+
+The first way that the projects can become incompatible is if the C code for 
OVN
+no longer can compile.
+
+The most likely case for this would be that an OVN change requires a parallel
+change to OVS. Those keeping up to date with OVN but not OVS will find that OVN
+will no longer compile since it refers to a nonexistent 

Re: [ovs-dev] [PATCH v2 9/9] system-traffic: Add zone-based conntrack timeout policy test

2019-08-06 Thread Yi-Hung Wei
On Tue, Aug 6, 2019 at 10:21 AM Darrell Ball  wrote:
>
>
> I did some more testing and found a similar problem as in V1.
>
> This test can be run successfully once and then fails after that.
> Maybe you want to look into that. It is probably related to:
>
> dball@ubuntu:~/openvswitch/ovs$ lsmod | grep nf
> .
> nfnetlink_cttimeout16384  1
> .
>
> Darrell
>

Thanks for trying out the test.  I can not reproduce the issue that
you mentioned on my local VM.

Can you provide your kernel version and system-kmod-testsuite.log?

Thanks,

-Yi-Hung
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 8/9] ofproto-dpif-xlate: Translate timeout policy in ct action

2019-08-06 Thread Darrell Ball
On Mon, Aug 5, 2019 at 8:51 PM Darrell Ball  wrote:

> Thanks for the patch
>
> The main comment I had from the V1 patch was adding the check
>
> +if (ofc->flags & NX_CT_F_COMMIT) {
>
> in compose_conntrack_action()
>
> I see that was done.
>
> After a quick scan, I had one minor comment inline.
>

I wanted to reiterate one more comment that I added to V1 regarding the
unwildcarding (inline).


>
> On Thu, Aug 1, 2019 at 3:12 PM Yi-Hung Wei  wrote:
>
>> This patch derives the timeout policy based on ct zone from the
>> internal data structure that reads the configuration from ovsdb.
>>
>> Signed-off-by: Yi-Hung Wei 
>> ---
>>  lib/ct-dpif.c| 10 ++
>>  lib/ct-dpif.h|  3 +++
>>  lib/dpif-netdev.c|  1 +
>>  lib/dpif-netlink.c   | 10 ++
>>  lib/dpif-provider.h  |  5 +
>>  ofproto/ofproto-dpif-xlate.c | 29 +
>>  ofproto/ofproto-dpif.c   | 24 
>>  ofproto/ofproto-provider.h   |  5 +
>>  ofproto/ofproto.c| 11 +++
>>  ofproto/ofproto.h|  2 ++
>>  10 files changed, 100 insertions(+)
>>
>> diff --git a/lib/ct-dpif.c b/lib/ct-dpif.c
>> index 7f9ce0a561f7..5d2acfd7810b 100644
>> --- a/lib/ct-dpif.c
>> +++ b/lib/ct-dpif.c
>> @@ -864,3 +864,13 @@ ct_dpif_timeout_policy_dump_done(struct dpif *dpif,
>> void *state)
>>  ? dpif->dpif_class->ct_timeout_policy_dump_done(dpif, state)
>>  : EOPNOTSUPP);
>>  }
>> +
>> +int
>> +ct_dpif_format_timeout_policy_name(struct dpif *dpif, uint32_t tp_id,
>> +   uint16_t dl_type, uint8_t nw_proto,
>> +   struct ds *ds)
>> +{
>> +return (dpif->dpif_class->ct_format_timeout_policy_name
>> +? dpif->dpif_class->ct_format_timeout_policy_name(
>> +dpif, tp_id, dl_type, nw_proto, ds) : EOPNOTSUPP);
>> +}
>> diff --git a/lib/ct-dpif.h b/lib/ct-dpif.h
>> index 8dacb1c7c253..0a27568880c0 100644
>> --- a/lib/ct-dpif.h
>> +++ b/lib/ct-dpif.h
>> @@ -318,5 +318,8 @@ int ct_dpif_timeout_policy_dump_start(struct dpif
>> *dpif, void **statep);
>>  int ct_dpif_timeout_policy_dump_next(struct dpif *dpif, void *state,
>>   struct ct_dpif_timeout_policy *tp);
>>  int ct_dpif_timeout_policy_dump_done(struct dpif *dpif, void *state);
>> +int ct_dpif_format_timeout_policy_name(struct dpif *dpif, uint32_t tp_id,
>> +   uint16_t dl_type, uint8_t
>> nw_proto,
>> +   struct ds *ds);
>>
>>  #endif /* CT_DPIF_H */
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index 7240a3e6f3c8..19cf9f21ec85 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> @@ -7539,6 +7539,7 @@ const struct dpif_class dpif_netdev_class = {
>>  NULL,   /* ct_timeout_policy_dump_start */
>>  NULL,   /* ct_timeout_policy_dump_next */
>>  NULL,   /* ct_timeout_policy_dump_done */
>> +NULL,   /* ct_format_timeout_policy_name */
>>  dpif_netdev_ipf_set_enabled,
>>  dpif_netdev_ipf_set_min_frag,
>>  dpif_netdev_ipf_set_max_nfrags,
>> diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
>> index b859508f718a..92da87027c58 100644
>> --- a/lib/dpif-netlink.c
>> +++ b/lib/dpif-netlink.c
>> @@ -3071,6 +3071,15 @@ dpif_netlink_format_tp_name(uint32_t id, uint16_t
>> l3num, uint8_t l4num,
>>  ovs_assert(tp_name->length < CTNL_TIMEOUT_NAME_MAX);
>>  }
>>
>> +static int
>> +dpif_netlink_ct_format_timeout_policy_name(struct dpif *dpif OVS_UNUSED,
>> +uint32_t tp_id, uint16_t dl_type, uint8_t nw_proto, struct ds *ds)
>> +{
>> +dpif_netlink_format_tp_name(tp_id,
>> +dl_type == ETH_TYPE_IP ? AF_INET : AF_INET6, nw_proto, ds);
>> +return 0;
>> +}
>> +
>>  #define CT_DPIF_NL_TP_TCP_MAPPINGS  \
>>  CT_DPIF_NL_TP_MAPPING(TCP, TCP, SYN_SENT, SYN_SENT) \
>>  CT_DPIF_NL_TP_MAPPING(TCP, TCP, SYN_RECV, SYN_RECV) \
>> @@ -3891,6 +3900,7 @@ const struct dpif_class dpif_netlink_class = {
>>  dpif_netlink_ct_timeout_policy_dump_start,
>>  dpif_netlink_ct_timeout_policy_dump_next,
>>  dpif_netlink_ct_timeout_policy_dump_done,
>> +dpif_netlink_ct_format_timeout_policy_name,
>>  NULL,   /* ipf_set_enabled */
>>  NULL,   /* ipf_set_min_frag */
>>  NULL,   /* ipf_set_max_nfrags */
>> diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
>> index 79a2314500cf..57b32ccb610f 100644
>> --- a/lib/dpif-provider.h
>> +++ b/lib/dpif-provider.h
>> @@ -536,6 +536,11 @@ struct dpif_class {
>> struct ct_dpif_timeout_policy
>> *tp);
>>  int (*ct_timeout_policy_dump_done)(struct dpif *, void *state);
>>
>> +/* Get timeout policy name (OVS_CT_ATTR_TIMEOUT) from 

Re: [ovs-dev] [PATCH v2 9/9] system-traffic: Add zone-based conntrack timeout policy test

2019-08-06 Thread Darrell Ball
On Mon, Aug 5, 2019 at 9:03 PM Darrell Ball  wrote:

> Thanks for the patch
>
> I see the test is much improved now from V1 and passes - thanks
>
> Ideally, tests should be associated with some code for context
> It could be folded into patch 8
>

I did some more testing and found a similar problem as in V1.

This test can be run successfully once and then fails after that.
Maybe you want to look into that. It is probably related to:

dball@ubuntu:~/openvswitch/ovs$ lsmod | grep nf
.
nfnetlink_cttimeout16384  1
.

Darrell


>
>
> On Thu, Aug 1, 2019 at 3:12 PM Yi-Hung Wei  wrote:
>
>> This patch adds a system traffic test to verify the zone-based conntrack
>> timeout feature.  The test uses ovs-vsctl commands to configure
>> the customized ICMP and UDP timeout on zone 5 to a shorter period.
>> It then injects ICMP and UDP traffic to conntrack, and checks if the
>> corresponding conntrack entry expires after the predefined timeout.
>>
>> Signed-off-by: Yi-Hung Wei 
>> ---
>>  tests/system-kmod-macros.at  | 25 +++
>>  tests/system-traffic.at  | 66
>> 
>>  tests/system-userspace-macros.at | 26 
>>  3 files changed, 117 insertions(+)
>>
>> diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at
>> index 554a61e9bd95..1bc6f246f426 100644
>> --- a/tests/system-kmod-macros.at
>> +++ b/tests/system-kmod-macros.at
>> @@ -100,6 +100,15 @@ m4_define([CHECK_CONNTRACK_FRAG_OVERLAP],
>>  #
>>  m4_define([CHECK_CONNTRACK_NAT])
>>
>> +# CHECK_CONNTRACK_TIMEOUT()
>> +#
>> +# Perform requirements checks for running conntrack customized timeout
>> tests.
>> +#
>> +m4_define([CHECK_CONNTRACK_TIMEOUT],
>> +[
>> +AT_SKIP_IF([! cat /boot/config-$(uname -r) | grep
>> NF_CONNTRACK_TIMEOUT | grep '=y' > /dev/null])
>> +])
>> +
>>  # CHECK_CT_DPIF_PER_ZONE_LIMIT()
>>  #
>>  # Perform requirements checks for running ovs-dpctl
>> ct-[set|get|del]-limits per
>> @@ -185,3 +194,19 @@ m4_define([OVS_CHECK_KERNEL_EXCL],
>>  sublevel=$(uname -r | sed -e 's/\./ /g' | awk '{print $ 2}')
>>  AT_SKIP_IF([ ! ( test $version -lt $1 || ( test $version -eq $1 &&
>> test $sublevel -lt $2 ) || test $version -gt $3 || ( test $version -eq $3
>> && test $sublevel -gt $4 ) ) ])
>>  ])
>> +
>> +# VSCTL_ADD_DATAPATH_TABLE()
>> +#
>> +# Create system datapath table "system" for kernel tests in ovsdb
>> +m4_define([VSCTL_ADD_DATAPATH_TABLE],
>> +[
>> +AT_CHECK([ovs-vsctl -- --id=@m create Datapath datapath_version=0 --
>> set Open_vSwitch . datapaths:"system"=@m], [0], [stdout])
>> +])
>> +
>> +# VSCTL_ADD_ZONE_TIMEOUT_POLICY([parameters])
>> +#
>> +# Add zone based timeout policy to kernel datapath
>> +m4_define([VSCTL_ADD_ZONE_TIMEOUT_POLICY],
>> +[
>> +AT_CHECK([ovs-vsctl add-zone-tp system $1], [0], [stdout])
>> +])
>> diff --git a/tests/system-traffic.at b/tests/system-traffic.at
>> index 1a04199dcfe9..f4ac8a8f2c06 100644
>> --- a/tests/system-traffic.at
>> +++ b/tests/system-traffic.at
>> @@ -3179,6 +3179,72 @@ NXST_FLOW reply:
>>  OVS_TRAFFIC_VSWITCHD_STOP
>>  AT_CLEANUP
>>
>> +AT_SETUP([conntrack - zone-based timeout policy])
>> +CHECK_CONNTRACK()
>> +CHECK_CONNTRACK_TIMEOUT()
>> +OVS_TRAFFIC_VSWITCHD_START()
>> +
>> +ADD_NAMESPACES(at_ns0, at_ns1)
>> +
>> +ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
>> +ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
>> +
>> +AT_DATA([flows.txt], [dnl
>> +priority=1,action=drop
>> +priority=10,arp,action=normal
>> +priority=100,in_port=1,ip,action=ct(zone=5, table=1)
>> +priority=100,in_port=2,ip,action=ct(zone=5, table=1)
>> +table=1,in_port=2,ip,ct_state=+trk+est,action=1
>> +table=1,in_port=1,ip,ct_state=+trk+new,action=ct(commit,zone=5),2
>> +table=1,in_port=1,ip,ct_state=+trk+est,action=2
>> +])
>> +
>> +AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
>> +
>> +dnl Test with default timeout
>> +dnl The default udp_single and icmp_first timeouts are 30 seconds in
>> +dnl kernel DP, and 60 seconds in userspace DP.
>> +
>> +dnl Send ICMP and UDP traffic
>> +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.1.1.2 |
>> FORMAT_PING], [0], [dnl
>> +3 packets transmitted, 3 received, 0% packet loss, time 0ms
>> +])
>> +AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1
>> packet=5054000a505400090800451c0011a4cd0a0101010a010102000100020008
>> actions=resubmit(,0)"])
>> +
>> +sleep 4
>> +
>> +AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2) | sort],
>> [0], [dnl
>>
>> +icmp,orig=(src=10.1.1.1,dst=10.1.1.2,id=,type=8,code=0),reply=(src=10.1.1.2,dst=10.1.1.1,id=,type=0,code=0),zone=5
>>
>> +udp,orig=(src=10.1.1.1,dst=10.1.1.2,sport=,dport=),reply=(src=10.1.1.2,dst=10.1.1.1,sport=,dport=),zone=5
>> +])
>> +
>> +AT_CHECK([ovs-appctl dpctl/flush-conntrack])
>> +
>> +dnl Shorten the udp_single and icmp_first timeout in zone 5
>> +VSCTL_ADD_DATAPATH_TABLE()
>> +VSCTL_ADD_ZONE_TIMEOUT_POLICY([zone=5 udp_single=3 icmp_first=3])
>> +
>> +dnl Send ICMP and UDP traffic

Re: [ovs-dev] [PATCH v5] Detailed packet drop statistics per dpdk and vhostuser ports

2019-08-06 Thread Ilya Maximets
On 24.07.2019 11:55, Sriram Vatala wrote:
> Hi,
> 
> @Ben : Thanks for the response.
> 
> @Ilya, @Ian : Can you please review the patch and provide comments if any.

Hi.
Thanks for working on this!

One thing about the patch is that it modifies the hot path, thus needs
a performance evaluation before applying. I hope to have some time for
it this week. Have you tested performance difference with and without
this patch?

Also, I see is that you're inserting fairly big array into PADDED_MEMBERS
block. There are few issues with that:

1. There is no need to store the whole 'struct netdev_custom_counter' for
   each netdev instance because names takes 64 bytes each and they are
   same for each netdev instance anyway.

2. You're not paying attention to the amount of pad bytes in this section
   after the change. I suspect a big hole in the structure here.

   Regarding this issue, actually, I'd like to remove this cacheline
   alignments completely from the structure (it had no performance impact
   for me previously), but it's a different change and there was no active
   support from the community when I wanted to do that few years ago.
   However, there was no strong objections too.
   Ian, do you have some thought about this?

Best regards, Ilya Maximets.

> 
> Thanks,
> Sriram.
> 
> -Original Message-
> From: Ben Pfaff  
> Sent: 22 July 2019 21:37
> To: Sriram Vatala 
> Cc: ovs-dev@openvswitch.org
> Subject: Re: [PATCH v5] Detailed packet drop statistics per dpdk and
> vhostuser ports
> 
> On Mon, Jul 22, 2019 at 03:31:53PM +0530, Sriram Vatala wrote:
>> OVS may be unable to transmit packets for multiple reasons and today 
>> there is a single counter to track packets dropped due to any of those 
>> reasons. The most common reason is that a VM is unable to read packets 
>> fast enough causing the vhostuser port transmit queue on the OVS side 
>> to become full. This manifests as a problem with VNFs not receiving 
>> all packets. Having a separate drop counter to track packets dropped 
>> because the transmit queue is full will clearly indicate that the 
>> problem is on the VM side and not in OVS. Similarly maintaining 
>> separate counters for all possible drops helps in indicating sensible 
>> cause for packet drops.
>>
>> This patch adds counters for custom stats to track packets dropped at 
>> port level and these stats are displayed along with other stats in 
>> "ovs-vsctl get interface  statistics"
>> command. The detailed stats will be available for both dpdk and 
>> vhostuser ports.
>>
>> Signed-off-by: Sriram Vatala 
> 
> Thanks for the revision!  I'm happy with the bits that are important to me.
> I'll leave the final review to Ian or Ilya.
> 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] Correct the include path when including the header files from lib folder

2019-08-06 Thread Numan Siddique
On Tue, Aug 6, 2019 at 8:26 PM Mark Michelson  wrote:

> Acked-by: Mark Michelson 
>

Thanks for the review. I applied this to master.

Numan


>
> On 8/6/19 8:56 AM, nusid...@redhat.com wrote:
> > From: Numan Siddique 
> >
> > Compilation will fail when we try to build ovn from external ovs
> directory.
> >
> > Earlier commit [1] missed changing the include path for lib/*.c files.
> >
> > [1] - a469954c00c4 ("Include ovn header files from lib/ instead of
> ovn/lib/")
> > Signed-off-by: Numan Siddique 
> > ---
> >   controller/ip-mcast.c   | 2 +-
> >   lib/acl-log.c   | 2 +-
> >   lib/actions.c   | 4 ++--
> >   lib/extend-table.c  | 2 +-
> >   lib/mcast-group-index.c | 4 ++--
> >   lib/ovn-nb-idl.ann  | 2 +-
> >   lib/ovn-util.c  | 4 ++--
> >   7 files changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/controller/ip-mcast.c b/controller/ip-mcast.c
> > index ef36be2ca..9b0b4465a 100644
> > --- a/controller/ip-mcast.c
> > +++ b/controller/ip-mcast.c
> > @@ -17,7 +17,7 @@
> >
> >   #include "ip-mcast.h"
> >   #include "lport.h"
> > -#include "ovn/lib/ovn-sb-idl.h"
> > +#include "lib/ovn-sb-idl.h"
> >
> >   /*
> >* Used for (faster) updating of IGMP_Group ports.
> > diff --git a/lib/acl-log.c b/lib/acl-log.c
> > index f47b0af43..220b6dc30 100644
> > --- a/lib/acl-log.c
> > +++ b/lib/acl-log.c
> > @@ -15,7 +15,7 @@
> >*/
> >
> >   #include 
> > -#include "ovn/lib/acl-log.h"
> > +#include "acl-log.h"
> >   #include 
> >   #include "flow.h"
> >   #include "openvswitch/json.h"
> > diff --git a/lib/actions.c b/lib/actions.c
> > index b0cb3490b..81950e7df 100644
> > --- a/lib/actions.c
> > +++ b/lib/actions.c
> > @@ -17,9 +17,11 @@
> >   #include 
> >   #include 
> >   #include 
> > +#include "acl-log.h"
> >   #include "bitmap.h"
> >   #include "byte-order.h"
> >   #include "compiler.h"
> > +#include "extend-table.h"
> >   #include "ovn-l7.h"
> >   #include "hash.h"
> >   #include "lib/packets.h"
> > @@ -33,8 +35,6 @@
> >   #include "ovn/actions.h"
> >   #include "ovn/expr.h"
> >   #include "ovn/lex.h"
> > -#include "ovn/lib/acl-log.h"
> > -#include "ovn/lib/extend-table.h"
> >   #include "packets.h"
> >   #include "openvswitch/shash.h"
> >   #include "simap.h"
> > diff --git a/lib/extend-table.c b/lib/extend-table.c
> > index ccf70ca72..77208feb5 100644
> > --- a/lib/extend-table.c
> > +++ b/lib/extend-table.c
> > @@ -18,10 +18,10 @@
> >   #include 
> >
> >   #include "bitmap.h"
> > +#include "extend-table.h"
> >   #include "hash.h"
> >   #include "lib/uuid.h"
> >   #include "openvswitch/vlog.h"
> > -#include "ovn/lib/extend-table.h"
> >
> >   VLOG_DEFINE_THIS_MODULE(extend_table);
> >
> > diff --git a/lib/mcast-group-index.c b/lib/mcast-group-index.c
> > index 740311e00..de80f545a 100644
> > --- a/lib/mcast-group-index.c
> > +++ b/lib/mcast-group-index.c
> > @@ -15,8 +15,8 @@
> >
> >   #include 
> >
> > -#include "ovn/lib/mcast-group-index.h"
> > -#include "ovn/lib/ovn-sb-idl.h"
> > +#include "mcast-group-index.h"
> > +#include "ovn-sb-idl.h"
> >
> >   struct ovsdb_idl_index *
> >   mcast_group_index_create(struct ovsdb_idl *idl)
> > diff --git a/lib/ovn-nb-idl.ann b/lib/ovn-nb-idl.ann
> > index 76d7384fc..ea813d658 100644
> > --- a/lib/ovn-nb-idl.ann
> > +++ b/lib/ovn-nb-idl.ann
> > @@ -6,4 +6,4 @@
> >   # it can generate more programmer-friendly data structures.
> >
> >   s["idlPrefix"] = "nbrec_"
> > -s["idlHeader"] = "\"ovn/lib/ovn-nb-idl.h\""
> > +s["idlHeader"] = "\"lib/ovn-nb-idl.h\""
> > diff --git a/lib/ovn-util.c b/lib/ovn-util.c
> > index de745d73f..085498fd1 100644
> > --- a/lib/ovn-util.c
> > +++ b/lib/ovn-util.c
> > @@ -16,8 +16,8 @@
> >   #include "ovn-util.h"
> >   #include "dirs.h"
> >   #include "openvswitch/vlog.h"
> > -#include "ovn/lib/ovn-nb-idl.h"
> > -#include "ovn/lib/ovn-sb-idl.h"
> > +#include "ovn-nb-idl.h"
> > +#include "ovn-sb-idl.h"
> >
> >   VLOG_DEFINE_THIS_MODULE(ovn_util);
> >
> >
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] Correct the include path when including the header files from lib folder

2019-08-06 Thread Mark Michelson

Acked-by: Mark Michelson 

On 8/6/19 8:56 AM, nusid...@redhat.com wrote:

From: Numan Siddique 

Compilation will fail when we try to build ovn from external ovs directory.

Earlier commit [1] missed changing the include path for lib/*.c files.

[1] - a469954c00c4 ("Include ovn header files from lib/ instead of ovn/lib/")
Signed-off-by: Numan Siddique 
---
  controller/ip-mcast.c   | 2 +-
  lib/acl-log.c   | 2 +-
  lib/actions.c   | 4 ++--
  lib/extend-table.c  | 2 +-
  lib/mcast-group-index.c | 4 ++--
  lib/ovn-nb-idl.ann  | 2 +-
  lib/ovn-util.c  | 4 ++--
  7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/controller/ip-mcast.c b/controller/ip-mcast.c
index ef36be2ca..9b0b4465a 100644
--- a/controller/ip-mcast.c
+++ b/controller/ip-mcast.c
@@ -17,7 +17,7 @@
  
  #include "ip-mcast.h"

  #include "lport.h"
-#include "ovn/lib/ovn-sb-idl.h"
+#include "lib/ovn-sb-idl.h"
  
  /*

   * Used for (faster) updating of IGMP_Group ports.
diff --git a/lib/acl-log.c b/lib/acl-log.c
index f47b0af43..220b6dc30 100644
--- a/lib/acl-log.c
+++ b/lib/acl-log.c
@@ -15,7 +15,7 @@
   */
  
  #include 

-#include "ovn/lib/acl-log.h"
+#include "acl-log.h"
  #include 
  #include "flow.h"
  #include "openvswitch/json.h"
diff --git a/lib/actions.c b/lib/actions.c
index b0cb3490b..81950e7df 100644
--- a/lib/actions.c
+++ b/lib/actions.c
@@ -17,9 +17,11 @@
  #include 
  #include 
  #include 
+#include "acl-log.h"
  #include "bitmap.h"
  #include "byte-order.h"
  #include "compiler.h"
+#include "extend-table.h"
  #include "ovn-l7.h"
  #include "hash.h"
  #include "lib/packets.h"
@@ -33,8 +35,6 @@
  #include "ovn/actions.h"
  #include "ovn/expr.h"
  #include "ovn/lex.h"
-#include "ovn/lib/acl-log.h"
-#include "ovn/lib/extend-table.h"
  #include "packets.h"
  #include "openvswitch/shash.h"
  #include "simap.h"
diff --git a/lib/extend-table.c b/lib/extend-table.c
index ccf70ca72..77208feb5 100644
--- a/lib/extend-table.c
+++ b/lib/extend-table.c
@@ -18,10 +18,10 @@
  #include 
  
  #include "bitmap.h"

+#include "extend-table.h"
  #include "hash.h"
  #include "lib/uuid.h"
  #include "openvswitch/vlog.h"
-#include "ovn/lib/extend-table.h"
  
  VLOG_DEFINE_THIS_MODULE(extend_table);
  
diff --git a/lib/mcast-group-index.c b/lib/mcast-group-index.c

index 740311e00..de80f545a 100644
--- a/lib/mcast-group-index.c
+++ b/lib/mcast-group-index.c
@@ -15,8 +15,8 @@
  
  #include 
  
-#include "ovn/lib/mcast-group-index.h"

-#include "ovn/lib/ovn-sb-idl.h"
+#include "mcast-group-index.h"
+#include "ovn-sb-idl.h"
  
  struct ovsdb_idl_index *

  mcast_group_index_create(struct ovsdb_idl *idl)
diff --git a/lib/ovn-nb-idl.ann b/lib/ovn-nb-idl.ann
index 76d7384fc..ea813d658 100644
--- a/lib/ovn-nb-idl.ann
+++ b/lib/ovn-nb-idl.ann
@@ -6,4 +6,4 @@
  # it can generate more programmer-friendly data structures.
  
  s["idlPrefix"] = "nbrec_"

-s["idlHeader"] = "\"ovn/lib/ovn-nb-idl.h\""
+s["idlHeader"] = "\"lib/ovn-nb-idl.h\""
diff --git a/lib/ovn-util.c b/lib/ovn-util.c
index de745d73f..085498fd1 100644
--- a/lib/ovn-util.c
+++ b/lib/ovn-util.c
@@ -16,8 +16,8 @@
  #include "ovn-util.h"
  #include "dirs.h"
  #include "openvswitch/vlog.h"
-#include "ovn/lib/ovn-nb-idl.h"
-#include "ovn/lib/ovn-sb-idl.h"
+#include "ovn-nb-idl.h"
+#include "ovn-sb-idl.h"
  
  VLOG_DEFINE_THIS_MODULE(ovn_util);
  



___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] RHEL: Suppress systemd status message during pre-installation.

2019-08-06 Thread Mark Michelson

Thanks, I applied this to master.

On 8/5/19 3:37 PM, Numan Siddique wrote:



On Mon, Aug 5, 2019 at 11:45 PM Mark Michelson > wrote:


When running the pre-installation hook, the spec file attempts to
determine if the old openvswitch-provided OVN services are running. If
this is a fresh installation, then there never was an
openvswitch-provided service installed on the machine. Therefore,
systemd will emit a warning saying the service can't be found. There is
nothing that indicates that this message is coming pre-installation, and
so it appears as though something has gone wrong while trying to install
the package.

This commit suppresses stderr when checking the status of the ovn
services pre-installation. This way, if a problem is encountered, it
does not appear that there was an error during installation.

Signed-off-by: Mark Michelson mailto:mmich...@redhat.com>>


Acked-by: Numan Siddique mailto:nusid...@redhat.com>>

---
  rhel/ovn-fedora.spec.in  | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rhel/ovn-fedora.spec.in 
b/rhel/ovn-fedora.spec.in 
index 2ecc629f2..2234e949f 100644
--- a/rhel/ovn-fedora.spec.in 
+++ b/rhel/ovn-fedora.spec.in 
@@ -219,7 +219,7 @@ rm -rf $RPM_BUILD_ROOT
  %pre central
  if [ $1 -eq 1 ] ; then
      # Package install.
-    /bin/systemctl status ovn-northd.service >/dev/null
+    /bin/systemctl status ovn-northd.service &>/dev/null
      ovn_status=$?
      rpm -ql openvswitch-ovn-central > /dev/null
      if [[ "$?" = "0" && "$ovn_status" = "0" ]]; then
@@ -233,7 +233,7 @@ fi
  %pre host
  if [ $1 -eq 1 ] ; then
      # Package install.
-    /bin/systemctl status ovn-controller.service >/dev/null
+    /bin/systemctl status ovn-controller.service &>/dev/null
      ovn_status=$?
      rpm -ql openvswitch-ovn-host > /dev/null
      if [[ "$?" = "0" && "$ovn_status" = "0" ]]; then
-- 
2.14.5


___
dev mailing list
d...@openvswitch.org 
https://mail.openvswitch.org/mailman/listinfo/ovs-dev



___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] Add -u option to ovn-nbctl

2019-08-06 Thread Mark Michelson

Thanks, I pushed this to master.

On 8/2/19 1:04 PM, Numan Siddique wrote:



On Fri, Aug 2, 2019 at 12:14 AM Mark Michelson > wrote:


This option can be used in one of two ways.

When paired with --detach, this creates a unixctl socket with the name
given as the argument to '-u'.

When not paired with --detach, this tells the ovn-nbctl client the name
of the unixctl socket to attempt to connect to.

Signed-off-by: Mark Michelson mailto:mmich...@redhat.com>>


Acked-by: Numan Siddique mailto:nusid...@redhat.com>>

---
  tests/ovn.at               | 19 +++
  utilities/ovn-nbctl.8.xml | 20 
  utilities/ovn-nbctl.c     | 17 +++--
  3 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/tests/ovn.at  b/tests/ovn.at 
index e88cffa20..533594849 100644
--- a/tests/ovn.at 
+++ b/tests/ovn.at 
@@ -14990,3 +14990,22 @@ OVN_CHECK_PACKETS([hv2/vif3-tx.pcap],
[expected])

  OVN_CLEANUP([hv1], [hv2])
  AT_CLEANUP
+
+AT_SETUP([ovn -- unixctl socket])
+ovn_start
+
+sockfile="$at_group_dir/my_sock.ctl"
+
+# Specifying -u should fail since we have no daemon running
+AT_CHECK([ovn-nbctl -u $sockfile show], [1], [ignore], [ignore])
+
+AT_CHECK_UNQUOTED([ovn-nbctl --detach -u $sockfile --pidfile], [0],
[$sockfile
+])
+AT_CHECK([if test -f "$sockfile" ; then exit 99 ; fi])
+on_exit 'kill $(cat ovn-nbctl.pid)'
+
+# We can't confirm that the nbctl client is actually using the
sockfile,
+# but we can still ensure that the command is successful.
+AT_CHECK([ovn-nbctl -u $sockfile show])
+
+AT_CLEANUP
diff --git a/utilities/ovn-nbctl.8.xml b/utilities/ovn-nbctl.8.xml
index 41d50b694..fd75c0e44 100644
--- a/utilities/ovn-nbctl.8.xml
+++ b/utilities/ovn-nbctl.8.xml
@@ -1085,6 +1085,26 @@
        unset OVN_NB_DAEMON
      

+    
+      When using daemon mode, an alternative to the OVN_NB_DAEMON
environment
+      variable is to specify a path for the Unix socket. When
starting the
+      ovn-nbctl daemon, specify the -u option with a
full path to
+      the location of the socket file. Here is an exmple:
+    
+
+    
+      ovn-nbctl --detach -u /tmp/mysock.ctl
+    
+
+    
+      Then to connect to the running daemon, use the
-u option
+      with the full path to the socket created when the daemon was
started:
+    
+
+    
+      ovn-nbctl -u /tmp/mysock.ctl show
+    
+
      
        Daemon mode is experimental.
      
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index ad999dd96..9a2e84530 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -167,8 +167,9 @@ main(int argc, char *argv[])
       *    - An OVN_NB_DAEMON environment variable implies client mode.
       *
       *    - Otherwise, we're in direct mode. */
-    char *socket_name = getenv("OVN_NB_DAEMON");
-    if (socket_name && socket_name[0]
+    char *socket_name = unixctl_path ?: getenv("OVN_NB_DAEMON");
+    if (((socket_name && socket_name[0])
+         || has_option(parsed_options, n_parsed_options, 'u'))
          && !will_detach(parsed_options, n_parsed_options)) {
          nbctl_client(socket_name, parsed_options, n_parsed_options,
                       argc, argv);
@@ -422,6 +423,7 @@ get_all_options(void)
          {"shuffle-remotes", no_argument, NULL, OPT_SHUFFLE_REMOTES},
          {"no-shuffle-remotes", no_argument, NULL,
OPT_NO_SHUFFLE_REMOTES},
          {"version", no_argument, NULL, 'V'},
+        {"unixctl", required_argument, NULL, 'u'},
          MAIN_LOOP_LONG_OPTIONS,
          DAEMON_LONG_OPTIONS,
          VLOG_LONG_OPTIONS,
@@ -533,6 +535,10 @@ apply_options_direct(const struct
ovs_cmdl_parsed_option *parsed_options,
              shuffle_remotes = false;
              break;

+        case 'u':
+            unixctl_path = optarg;
+            break;
+
          case 'V':
              ovs_print_version(0, 0);
              printf("DB Schema %s\n", nbrec_get_db_version());
@@ -5996,6 +6002,10 @@ nbctl_client(const char *socket_name,
                        po->o->name);
              break;

+        case 'u':
+            socket_name = optarg;
+            break;
+
          case 'V':
              ovs_print_version(0, 0);
              printf("DB Schema %s\n", nbrec_get_db_version());
@@ -6020,6 +6030,9 @@ nbctl_client(const char *socket_name,
              break;
          }
      }
+
+    ovs_assert(socket_name && socket_name[0]);
+
      

Re: [ovs-dev] [PATCH 0/3] travis: Build time optimization.

2019-08-06 Thread Aaron Conole
Ilya Maximets  writes:

> These are low-hanging optimizations for TravisCI that allows
> to speed up build without changing the test scope.
>
> On 'xenial' images this patch set gives ~30% build time improvement.
> Example:
>
>   Before:
> Ran for 1 hr 22 min 26 sec
> Total time 5 hrs 40 min 56 sec
>
>   After (second run after the cache population):
> Ran for 55 min 42 sec
> Total time 4 hrs 21 min 14 sec
>
>   Saved:
> Run time: ~27 minutes
> Total time: ~1 hour 20 minutes
>
> Ilya Maximets (3):
>   travis: Cache DPDK build.
>   travis: Combine kernel builds.
>   travis: Drop OSX workarounds.
>
>  .travis.yml| 22 +
>  .travis/linux-build.sh | 74 +-
>  .travis/osx-prepare.sh |  3 --
>  3 files changed, 67 insertions(+), 32 deletions(-)

I'm always in favor of saving resources. :)

It doesn't seem to break anything existing.

Acked-by: Aaron Conole 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH branch 2.12] OVN: fix default L4 default proto reported by ovn-nbctl

2019-08-06 Thread Lorenzo Bianconi
If no protcol is specified defining a load balancing rule TCP is
selected as default but ovn-nbctl lb-list reports 'tcp/udp' in this
case. Fix it reporting tcp in this case

Fixes: e2bfcad6cbb0 ("ovn-nbctl: Add LB commands")
Acked-by: Dumitru Ceara 
Signed-off-by: Lorenzo Bianconi 
---
 ovn/utilities/ovn-nbctl.c |  2 +-
 tests/ovn-nbctl.at| 24 
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 98a8faa0b..7a38b2bf7 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -2864,7 +2864,7 @@ lb_info_add_smap(const struct nbrec_load_balancer *lb,
 continue;
 }
 
-char *protocol = ss_get_port() ? lb->protocol : "tcp/udp";
+char *protocol = ss_get_port() ? lb->protocol : "tcp";
 i == 0 ? ds_put_format(,
 UUID_FMT "%-20.16s%-11.7s%-*.*s%s",
 UUID_ARGS(>header_.uuid),
diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index 18c5c1d42..e87242c03 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -657,8 +657,8 @@ AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl
 UUIDLB  PROTO  VIP 
IPs
 <0>lb0 tcp30.0.0.10:80
192.168.10.10:80,192.168.10.20:80
 <1>lb1 udp30.0.0.10:80
192.168.10.10:80,192.168.10.20:8080
-<2>lb2 tcp/udp30.0.0.30   192.168.10.10
-<3>lb3 tcp/udp30.0.0.30   192.168.10.10
+<2>lb2 tcp30.0.0.30   192.168.10.10
+<3>lb3 tcp30.0.0.30   192.168.10.10
 ])
 AT_CHECK([ovn-nbctl lb-del lb2 30.0.0.30])
 AT_CHECK([ovn-nbctl lb-del lb3 30.0.0.30])
@@ -710,14 +710,14 @@ AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUIDLB  PROTO  VIP 
IPs
 <0>lb0 tcp30.0.0.10:80
192.168.10.10:80,192.168.10.20:80
 <1>lb1 udp30.0.0.10:80
192.168.10.10:80,192.168.10.20:80
-<2>lb3 tcp/udp30.0.0.10   
192.168.10.10,192.168.10.20
+<2>lb3 tcp30.0.0.10   
192.168.10.10,192.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl ls-lb-del ls0 lb0])
 AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUIDLB  PROTO  VIP 
IPs
 <0>lb1 udp30.0.0.10:80
192.168.10.10:80,192.168.10.20:80
-<1>lb3 tcp/udp30.0.0.10   
192.168.10.10,192.168.10.20
+<1>lb3 tcp30.0.0.10   
192.168.10.10,192.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl ls-lb-del ls0 lb1])
@@ -746,14 +746,14 @@ AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
 UUIDLB  PROTO  VIP 
IPs
 <0>lb0 tcp30.0.0.10:80
192.168.10.10:80,192.168.10.20:80
 <1>lb1 udp30.0.0.10:80
192.168.10.10:80,192.168.10.20:80
-<2>lb3 tcp/udp30.0.0.10   
192.168.10.10,192.168.10.20
+<2>lb3 tcp30.0.0.10   
192.168.10.10,192.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl lr-lb-del lr0 lb0])
 AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
 UUIDLB  PROTO  VIP 
IPs
 <0>lb1 udp30.0.0.10:80
192.168.10.10:80,192.168.10.20:80
-<1>lb3 tcp/udp30.0.0.10   
192.168.10.10,192.168.10.20
+<1>lb3 tcp30.0.0.10   
192.168.10.10,192.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl lr-lb-del lr0 lb1])
@@ -924,8 +924,8 @@ AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl
 UUIDLB  PROTO  VIP 
 IPs
 <0>lb0 tcp[[ae0f::10]]:80
[[fd0f::10]]:80,[[fd0f::20]]:80
 <1>lb1 udp[[ae0f::10]]:80
[[fd0f::10]]:80,[[fd0f::20]]:8080
-<2>lb2 tcp/udpae0f::30 fd0f::10
-<3>lb3 tcp/udpae0f::30 fd0f::10
+<2>lb2 tcpae0f::30 fd0f::10
+<3>lb3 tcpae0f::30 fd0f::10
 ])
 AT_CHECK([ovn-nbctl lb-del lb2 ae0f::30])
 AT_CHECK([ovn-nbctl lb-del lb3 ae0f::30])
@@ -977,14 +977,14 @@ AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUIDLB  PROTO  VIP 
 IPs
 <0>lb0 tcp[[ae0f::10]]:80
[[fd0f::10]]:80,[[fd0f::20]]:80
 <1>lb1 udp[[ae0f::10]]:80
[[fd0f::10]]:80,[[fd0f::20]]:80
-<2>lb3 

Re: [ovs-dev] [PATCH branch-2.5] travis: Drop 2.6.32 kernel build.

2019-08-06 Thread Aaron Conole
Ilya Maximets  writes:

> gcc >= 5 can't build Linux kernel 2.6.32 and this will never
> change because 2.6.32 is not supported for a last few years.
>
> TravsCI migrated to use Ubuntu Xenial by defualt with gcc 5
> installed. Dropping the 2.6.32 build item to unlock green build.
>
> Signed-off-by: Ilya Maximets 
> ---
>
> Sending this patch as it was a preferred solution for a few
> people in discussion here:
>https://mail.openvswitch.org/pipermail/ovs-dev/2019-August/361278.html
>
> Two patches additionally needs to be backported for successful Travis
> build:
>
>   a7021b08b 2018-07-09 | configure: Disable -Wnull-pointer-arithmetic Clang 
> warning. [Ben Pfaff]
>   1e78e3085 2017-01-26 | libX.pc: use the correct output directory [Aaron 
> Conole]
>
> I could backport them along with applying this patch.

If you apply this, please do backport those patches.

>  .travis.yml | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 90aedef7e..92132e384 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -30,7 +30,6 @@ env:
>- KERNEL=3.10.96
>- KERNEL=3.4.110
>- KERNEL=3.2.76
> -  - KERNEL=2.6.32.70
>  
>  script: ./.travis/build.sh $OPTS
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH branch-2.5] travis: Drop 2.6.32 kernel build.

2019-08-06 Thread Ilya Maximets
gcc >= 5 can't build Linux kernel 2.6.32 and this will never
change because 2.6.32 is not supported for a last few years.

TravsCI migrated to use Ubuntu Xenial by defualt with gcc 5
installed. Dropping the 2.6.32 build item to unlock green build.

Signed-off-by: Ilya Maximets 
---

Sending this patch as it was a preferred solution for a few
people in discussion here:
   https://mail.openvswitch.org/pipermail/ovs-dev/2019-August/361278.html

Two patches additionally needs to be backported for successful Travis
build:

  a7021b08b 2018-07-09 | configure: Disable -Wnull-pointer-arithmetic Clang 
warning. [Ben Pfaff]
  1e78e3085 2017-01-26 | libX.pc: use the correct output directory [Aaron 
Conole]

I could backport them along with applying this patch.

 .travis.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 90aedef7e..92132e384 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,7 +30,6 @@ env:
   - KERNEL=3.10.96
   - KERNEL=3.4.110
   - KERNEL=3.2.76
-  - KERNEL=2.6.32.70
 
 script: ./.travis/build.sh $OPTS
 
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH ovn] Correct the include path when including the header files from lib folder

2019-08-06 Thread nusiddiq
From: Numan Siddique 

Compilation will fail when we try to build ovn from external ovs directory.

Earlier commit [1] missed changing the include path for lib/*.c files.

[1] - a469954c00c4 ("Include ovn header files from lib/ instead of ovn/lib/")
Signed-off-by: Numan Siddique 
---
 controller/ip-mcast.c   | 2 +-
 lib/acl-log.c   | 2 +-
 lib/actions.c   | 4 ++--
 lib/extend-table.c  | 2 +-
 lib/mcast-group-index.c | 4 ++--
 lib/ovn-nb-idl.ann  | 2 +-
 lib/ovn-util.c  | 4 ++--
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/controller/ip-mcast.c b/controller/ip-mcast.c
index ef36be2ca..9b0b4465a 100644
--- a/controller/ip-mcast.c
+++ b/controller/ip-mcast.c
@@ -17,7 +17,7 @@
 
 #include "ip-mcast.h"
 #include "lport.h"
-#include "ovn/lib/ovn-sb-idl.h"
+#include "lib/ovn-sb-idl.h"
 
 /*
  * Used for (faster) updating of IGMP_Group ports.
diff --git a/lib/acl-log.c b/lib/acl-log.c
index f47b0af43..220b6dc30 100644
--- a/lib/acl-log.c
+++ b/lib/acl-log.c
@@ -15,7 +15,7 @@
  */
 
 #include 
-#include "ovn/lib/acl-log.h"
+#include "acl-log.h"
 #include 
 #include "flow.h"
 #include "openvswitch/json.h"
diff --git a/lib/actions.c b/lib/actions.c
index b0cb3490b..81950e7df 100644
--- a/lib/actions.c
+++ b/lib/actions.c
@@ -17,9 +17,11 @@
 #include 
 #include 
 #include 
+#include "acl-log.h"
 #include "bitmap.h"
 #include "byte-order.h"
 #include "compiler.h"
+#include "extend-table.h"
 #include "ovn-l7.h"
 #include "hash.h"
 #include "lib/packets.h"
@@ -33,8 +35,6 @@
 #include "ovn/actions.h"
 #include "ovn/expr.h"
 #include "ovn/lex.h"
-#include "ovn/lib/acl-log.h"
-#include "ovn/lib/extend-table.h"
 #include "packets.h"
 #include "openvswitch/shash.h"
 #include "simap.h"
diff --git a/lib/extend-table.c b/lib/extend-table.c
index ccf70ca72..77208feb5 100644
--- a/lib/extend-table.c
+++ b/lib/extend-table.c
@@ -18,10 +18,10 @@
 #include 
 
 #include "bitmap.h"
+#include "extend-table.h"
 #include "hash.h"
 #include "lib/uuid.h"
 #include "openvswitch/vlog.h"
-#include "ovn/lib/extend-table.h"
 
 VLOG_DEFINE_THIS_MODULE(extend_table);
 
diff --git a/lib/mcast-group-index.c b/lib/mcast-group-index.c
index 740311e00..de80f545a 100644
--- a/lib/mcast-group-index.c
+++ b/lib/mcast-group-index.c
@@ -15,8 +15,8 @@
 
 #include 
 
-#include "ovn/lib/mcast-group-index.h"
-#include "ovn/lib/ovn-sb-idl.h"
+#include "mcast-group-index.h"
+#include "ovn-sb-idl.h"
 
 struct ovsdb_idl_index *
 mcast_group_index_create(struct ovsdb_idl *idl)
diff --git a/lib/ovn-nb-idl.ann b/lib/ovn-nb-idl.ann
index 76d7384fc..ea813d658 100644
--- a/lib/ovn-nb-idl.ann
+++ b/lib/ovn-nb-idl.ann
@@ -6,4 +6,4 @@
 # it can generate more programmer-friendly data structures.
 
 s["idlPrefix"] = "nbrec_"
-s["idlHeader"] = "\"ovn/lib/ovn-nb-idl.h\""
+s["idlHeader"] = "\"lib/ovn-nb-idl.h\""
diff --git a/lib/ovn-util.c b/lib/ovn-util.c
index de745d73f..085498fd1 100644
--- a/lib/ovn-util.c
+++ b/lib/ovn-util.c
@@ -16,8 +16,8 @@
 #include "ovn-util.h"
 #include "dirs.h"
 #include "openvswitch/vlog.h"
-#include "ovn/lib/ovn-nb-idl.h"
-#include "ovn/lib/ovn-sb-idl.h"
+#include "ovn-nb-idl.h"
+#include "ovn-sb-idl.h"
 
 VLOG_DEFINE_THIS_MODULE(ovn_util);
 
-- 
2.21.0

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] memory leak in internal_dev_create

2019-08-06 Thread Hillf Danton


On Tue, 06 Aug 2019 01:58:05 -0700
> Hello,
> 
> syzbot found the following crash on:
> 
> HEAD commit:1e78030e Merge tag 'mmc-v5.3-rc1' of git://git.kernel.org/..
> git tree:   upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=148d3d1a60
> kernel config:  https://syzkaller.appspot.com/x/.config?x=30cef20daf3e9977
> dashboard link: https://syzkaller.appspot.com/bug?extid=13210896153522fe1ee5
> compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=136aa8c460
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=109ba79260
> 
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+13210896153522fe1...@syzkaller.appspotmail.com
> 
> BUG: memory leak
> unreferenced object 0x8881207e4100 (size 128):
>comm "syz-executor032", pid 7014, jiffies 4294944027 (age 13.830s)
>hex dump (first 32 bytes):
>  00 70 16 18 81 88 ff ff 80 af 8c 22 81 88 ff ff  .p."
>  00 b6 23 17 81 88 ff ff 00 00 00 00 00 00 00 00  ..#.
>backtrace:
>  [<0eb78212>] kmemleak_alloc_recursive  
> include/linux/kmemleak.h:43 [inline]
>  [<0eb78212>] slab_post_alloc_hook mm/slab.h:522 [inline]
>  [<0eb78212>] slab_alloc mm/slab.c:3319 [inline]
>  [<0eb78212>] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3548
>  [<006ea6c6>] kmalloc include/linux/slab.h:552 [inline]
>  [<006ea6c6>] kzalloc include/linux/slab.h:748 [inline]
>  [<006ea6c6>] ovs_vport_alloc+0x37/0xf0  
> net/openvswitch/vport.c:130
>  [] internal_dev_create+0x24/0x1d0  
> net/openvswitch/vport-internal_dev.c:164
>  [<56ee7c13>] ovs_vport_add+0x81/0x190  
> net/openvswitch/vport.c:199
>  [<5434efc7>] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
>  [] ovs_dp_cmd_new+0x22f/0x410  
> net/openvswitch/datapath.c:1614
>  [] genl_family_rcv_msg+0x2ab/0x5b0  
> net/netlink/genetlink.c:629
>  [] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
>  [<6694b647>] netlink_rcv_skb+0x61/0x170  
> net/netlink/af_netlink.c:2477
>  [<88381f37>] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
>  [] netlink_unicast_kernel  
> net/netlink/af_netlink.c:1302 [inline]
>  [] netlink_unicast+0x1ec/0x2d0  
> net/netlink/af_netlink.c:1328
>  [<67e6b079>] netlink_sendmsg+0x270/0x480  
> net/netlink/af_netlink.c:1917
>  [] sock_sendmsg_nosec net/socket.c:637 [inline]
>  [] sock_sendmsg+0x54/0x70 net/socket.c:657
>  [<4cb7c11d>] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311
>  [] __sys_sendmsg+0x80/0xf0 net/socket.c:2356
>  [] __do_sys_sendmsg net/socket.c:2365 [inline]
>  [] __se_sys_sendmsg net/socket.c:2363 [inline]
>  [] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2363
> 
> BUG: memory leak
> unreferenced object 0x88811723b600 (size 64):
>comm "syz-executor032", pid 7014, jiffies 4294944027 (age 13.830s)
>hex dump (first 32 bytes):
>  01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  
>  00 00 00 00 00 00 00 00 02 00 00 00 05 35 82 c1  .5..
>backtrace:
>  [<352f46d8>] kmemleak_alloc_recursive  
> include/linux/kmemleak.h:43 [inline]
>  [<352f46d8>] slab_post_alloc_hook mm/slab.h:522 [inline]
>  [<352f46d8>] slab_alloc mm/slab.c:3319 [inline]
>  [<352f46d8>] __do_kmalloc mm/slab.c:3653 [inline]
>  [<352f46d8>] __kmalloc+0x169/0x300 mm/slab.c:3664
>  [<8e48f3d1>] kmalloc include/linux/slab.h:557 [inline]
>  [<8e48f3d1>] ovs_vport_set_upcall_portids+0x54/0xd0  
> net/openvswitch/vport.c:343
>  [<541e4f4a>] ovs_vport_alloc+0x7f/0xf0  
> net/openvswitch/vport.c:139
>  [] internal_dev_create+0x24/0x1d0  
> net/openvswitch/vport-internal_dev.c:164
>  [<56ee7c13>] ovs_vport_add+0x81/0x190  
> net/openvswitch/vport.c:199
>  [<5434efc7>] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
>  [] ovs_dp_cmd_new+0x22f/0x410  
> net/openvswitch/datapath.c:1614
>  [] genl_family_rcv_msg+0x2ab/0x5b0  
> net/netlink/genetlink.c:629
>  [] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
>  [<6694b647>] netlink_rcv_skb+0x61/0x170  
> net/netlink/af_netlink.c:2477
>  [<88381f37>] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
>  [] netlink_unicast_kernel  
> net/netlink/af_netlink.c:1302 [inline]
>  [] netlink_unicast+0x1ec/0x2d0  
> net/netlink/af_netlink.c:1328
>  [<67e6b079>] 

Re: [ovs-dev] [branch 2.12] ovn-northd: fixed memory leak in ovn_port_update_sbrec()

2019-08-06 Thread 0-day Robot
Bleep bloop.  Greetings Numan Siddique, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Unexpected sign-offs from developers who are not authors or co-authors 
or committers: Numan Siddique 
Lines checked: 42, Warnings: 1, Errors: 0


Please check this out.  If you feel there has been an error, please email 
acon...@bytheb.org

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 3/3] travis: Drop OSX workarounds.

2019-08-06 Thread Ilya Maximets
TravisCI currently uses xcode9.4 as a default image and it
it has good version of libtool out-of-the-box.
Removing these workarounds saves 4-6 minutes of OSX build.

Signed-off-by: Ilya Maximets 
---
 .travis/osx-prepare.sh | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/.travis/osx-prepare.sh b/.travis/osx-prepare.sh
index 4725fd829..58ccb67cd 100755
--- a/.travis/osx-prepare.sh
+++ b/.travis/osx-prepare.sh
@@ -2,6 +2,3 @@
 set -ev
 pip2 install --user six
 pip2 install --user --upgrade docutils
-
-brew update || true
-brew uninstall libtool && brew install libtool || true
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 2/3] travis: Combine kernel builds.

2019-08-06 Thread Ilya Maximets
Single kernel build job takes ~3 minutes in average. Most of
this time takes VM spawning and initial configuration.
Combining these 24 jobs in 4 allows us to better utilize workers
and not waste time on spawning VMs.

Before:

24 jobs * 3 minutes = 72 minutes
72 minutes / 5 workers = 14.4 minutes / worker

After:

4 jobs * 10 minutes = 40 minutes
40 minutes / 4 workers = 10 minutes / worker
+ 1 free worker that able to run other jobs at the same time.

Signed-off-by: Ilya Maximets 
---
 .travis.yml| 18 -
 .travis/linux-build.sh | 46 +-
 2 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 7fe4bfacf..370b3d0a6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,24 +34,14 @@ env:
   - OPTS="--disable-ssl"
   - TESTSUITE=1 KERNEL=3.16
   - TESTSUITE=1 OPTS="--enable-shared"
+  - TESTSUITE=1 DPDK=1
+  - TESTSUITE=1 LIBS=-ljemalloc
+  - KERNEL_LIST="5.0  4.20 4.19 4.18 4.17 4.16"
+  - KERNEL_LIST="4.15 4.14 4.9  4.4  3.19 3.16"
   - BUILD_ENV="-m32" OPTS="--disable-ssl"
   - DPDK=1 OPTS="--enable-shared"
-  - TESTSUITE=1 DPDK=1
   - DPDK_SHARED=1
   - DPDK_SHARED=1 OPTS="--enable-shared"
-  - KERNEL=5.0
-  - KERNEL=4.20
-  - KERNEL=4.19
-  - KERNEL=4.18
-  - KERNEL=4.17
-  - KERNEL=4.16
-  - KERNEL=4.15
-  - KERNEL=4.14
-  - KERNEL=4.9
-  - KERNEL=4.4
-  - KERNEL=3.19
-  - KERNEL=3.16
-  - TESTSUITE=1 LIBS=-ljemalloc
 
 matrix:
   include:
diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 98aa12b22..1577ae516 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -31,6 +31,8 @@ function install_kernel()
  sed 's/.*\..*\.\(.*\)/\1/' | sort -h | tail -1)
 version="${1}.${lo_ver}"
 
+rm -rf index* linux-*
+
 url="${base_url}/linux-${version}.tar.xz"
 # Download kernel sources. Try direct link on CDN failure.
 wget ${url} || wget ${url} || wget ${url/cdn/www}
@@ -117,6 +119,23 @@ function configure_ovs()
 ./boot.sh && ./configure $* || { cat config.log; exit 1; }
 }
 
+function build_ovs()
+{
+local KERNEL=$1
+
+configure_ovs $OPTS
+make selinux-policy
+
+# Only build datapath if we are testing kernel w/o running testsuite
+if [ "${KERNEL}" ]; then
+pushd datapath
+make -j4
+popd
+else
+make -j4
+fi
+}
+
 if [ "$KERNEL" ]; then
 install_kernel $KERNEL
 fi
@@ -132,18 +151,19 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
 fi
 fi
 
-OPTS="$EXTRA_OPTS $*"
-
 if [ "$CC" = "clang" ]; then
 export OVS_CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
 elif [[ $BUILD_ENV =~ "-m32" ]]; then
 # Disable sparse for 32bit builds on 64bit machine
 export OVS_CFLAGS="$CFLAGS $BUILD_ENV"
 else
-OPTS="$OPTS --enable-sparse"
+OPTS="--enable-sparse"
 export OVS_CFLAGS="$CFLAGS $BUILD_ENV $SPARSE_FLAGS"
 fi
 
+save_OPTS="${OPTS} $*"
+OPTS="${EXTRA_OPTS} ${save_OPTS}"
+
 if [ "$TESTSUITE" ]; then
 # 'distcheck' will reconfigure with required options.
 # Now we only need to prepare the Makefile without sparse-wrapped CC.
@@ -156,14 +176,20 @@ if [ "$TESTSUITE" ]; then
 exit 1
 fi
 else
-configure_ovs $OPTS
-make selinux-policy
-
-# Only build datapath if we are testing kernel w/o running testsuite
-if [ "$KERNEL" ]; then
-cd datapath
+if [ -z "${KERNEL_LIST}" ]; then build_ovs ${KERNEL};
+else
+save_EXTRA_OPTS="${EXTRA_OPTS}"
+for KERNEL in ${KERNEL_LIST}; do
+echo "=="
+echo "Building with kernel ${KERNEL}"
+echo "=="
+EXTRA_OPTS="${save_EXTRA_OPTS}"
+install_kernel ${KERNEL}
+OPTS="${EXTRA_OPTS} ${save_OPTS}"
+build_ovs ${KERNEL}
+make distclean
+done
 fi
-make -j4
 fi
 
 exit 0
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 0/3] travis: Build time optimization.

2019-08-06 Thread Ilya Maximets
These are low-hanging optimizations for TravisCI that allows
to speed up build without changing the test scope.

On 'xenial' images this patch set gives ~30% build time improvement.
Example:

  Before:
Ran for 1 hr 22 min 26 sec
Total time 5 hrs 40 min 56 sec

  After (second run after the cache population):
Ran for 55 min 42 sec
Total time 4 hrs 21 min 14 sec

  Saved:
Run time: ~27 minutes
Total time: ~1 hour 20 minutes

Ilya Maximets (3):
  travis: Cache DPDK build.
  travis: Combine kernel builds.
  travis: Drop OSX workarounds.

 .travis.yml| 22 +
 .travis/linux-build.sh | 74 +-
 .travis/osx-prepare.sh |  3 --
 3 files changed, 67 insertions(+), 32 deletions(-)

-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 1/3] travis: Cache DPDK build.

2019-08-06 Thread Ilya Maximets
This change enables cache for DPDK build directory, so we'll never
build same version of DPDK again. This speeds up each DPDK related
job by 4-6 minutes effectively saving 30-50 minutes of the total time.
Ex. Full TravisCI run on 'trusty' images:

  Without cache:
Ran for 1 hr 9 min 29 sec
Total time 4 hrs 55 min 13 sec

  With populated cache:
Ran for 1 hr 2 min 18 sec
Total time 4 hrs 20 min 9 sec

Saved:
  Real time: ~7 minutes.
  Total worker time: ~35 minutes.

Signed-off-by: Ilya Maximets 
---
 .travis.yml|  4 
 .travis/linux-build.sh | 28 +++-
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 782f72fea..7fe4bfacf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,10 @@ compiler:
 os:
   - linux
 
+cache:
+  directories:
+- dpdk-dir
+
 addons:
   apt:
 packages:
diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 17428fa6b..98aa12b22 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -65,16 +65,33 @@ function install_kernel()
 
 function install_dpdk()
 {
-if [ "${1##refs/*/}" != "${1}" ]; then
+local DPDK_VER=$1
+local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
+
+if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
+# Avoid using cache for git tree build.
+rm -rf dpdk-dir
+
 DPDK_GIT=${DPDK_GIT:-https://dpdk.org/git/dpdk}
-git clone --single-branch $DPDK_GIT dpdk-git -b "${1##refs/*/}"
-cd dpdk-git
+git clone --single-branch $DPDK_GIT dpdk-dir -b "${DPDK_VER##refs/*/}"
+pushd dpdk-dir
 git log -1 --oneline
 else
+if [ -f "${VERSION_FILE}" ]; then
+VER=$(cat ${VERSION_FILE})
+if [ "${VER}" = "${DPDK_VER}" ]; then
+EXTRA_OPTS="${EXTRA_OPTS} --with-dpdk=$(pwd)/dpdk-dir/build"
+echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
+return
+fi
+fi
+# No cache or version mismatch.
+rm -rf dpdk-dir
 wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz
 tar xvf dpdk-$1.tar.xz > /dev/null
 DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/")
-cd $DIR_NAME
+mv ${DIR_NAME} dpdk-dir
+pushd dpdk-dir
 fi
 
 make config CC=gcc T=$TARGET
@@ -91,7 +108,8 @@ function install_dpdk()
 make -j4 CC=gcc EXTRA_CFLAGS='-fPIC'
 EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build"
 echo "Installed DPDK source in $(pwd)"
-cd ..
+popd
+echo "${DPDK_VER}" > ${VERSION_FILE}
 }
 
 function configure_ovs()
-- 
2.17.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/1] ovn-northd: fixed memory leak in ovn_port_update_sbrec()

2019-08-06 Thread Numan Siddique
On Fri, Aug 2, 2019 at 9:43 PM Numan Siddique  wrote:

>
>
> On Fri, Aug 2, 2019 at 5:45 PM Damijan Skvarc 
> wrote:
>
>> Memory leak happens because of redundand memory allocation for array
>> of single pointer. Issue was solved by removing this redundand allocation
>> and using address of pointer to created chassis sb_ha_entity instead.
>>
>> Signed-off-by: Damijan Skvarc 
>>
>
> Acked-by: Numan Siddique 
>
>
I applied this patch to master. There was below checkpatch warning and I
fixed it like below before applying.
I have also submitted the patch for 2.12 branch -
https://patchwork.ozlabs.org/patch/1142719/

**8
WARNING: Line is 94 characters long (recommended limit is 79)
#27 FILE: northd/ovn-northd.c:2509:
struct sbrec_ha_chassis *sb_ha_ch =
create_sb_ha_chassis(ctx, chassis,

Lines checked: 37, Warnings: 1, Errors: 0


diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 2dbce4c16..e6953a405 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -2506,8 +2506,9 @@ ovn_port_update_sbrec(struct northd_context *ctx,
 }

 if (sb_ha_ch_grp->n_ha_chassis != 1) {
-struct sbrec_ha_chassis *sb_ha_ch =
create_sb_ha_chassis(ctx, chassis,
-   chassis->name,
0);
+struct sbrec_ha_chassis *sb_ha_ch =
+create_sb_ha_chassis(ctx, chassis,
+ chassis->name, 0);
 sbrec_ha_chassis_group_set_ha_chassis(sb_ha_ch_grp,
   _ha_ch,
1);
 }


Thanks
Numan


>
>
>> ---
>>  northd/ovn-northd.c | 6 ++
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
>> index cd776fa..d99ae67 100644
>> --- a/northd/ovn-northd.c
>> +++ b/northd/ovn-northd.c
>> @@ -2506,12 +2506,10 @@ ovn_port_update_sbrec(struct northd_context *ctx,
>>  }
>>
>>  if (sb_ha_ch_grp->n_ha_chassis != 1) {
>> -struct sbrec_ha_chassis **sb_ha_ch =
>> -xcalloc(1, sizeof *sb_ha_ch);
>> -sb_ha_ch[0] = create_sb_ha_chassis(ctx, chassis,
>> +struct sbrec_ha_chassis *sb_ha_ch =
>> create_sb_ha_chassis(ctx, chassis,
>>
>> chassis->name, 0);
>>
>>  sbrec_ha_chassis_group_set_ha_chassis(sb_ha_ch_grp,
>> -  sb_ha_ch,
>> 1);
>> +  _ha_ch,
>> 1);
>>  }
>>  sbrec_port_binding_set_ha_chassis_group(op->sb,
>>
>>  sb_ha_ch_grp);
>> --
>> 2.7.4
>>
>> ___
>> dev mailing list
>> d...@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [branch 2.12] ovn-northd: fixed memory leak in ovn_port_update_sbrec()

2019-08-06 Thread nusiddiq
From: Damijan Skvarc 

Memory leak happens because of redundand memory allocation for array
of single pointer. Issue was solved by removing this redundand allocation
and using address of pointer to created chassis sb_ha_entity instead.

Signed-off-by: Damijan Skvarc 
Acked-by: Numan Siddique 
Signed-off-by: Numan Siddique 

(cherry-picked from ovn commit 800c4f338411c41d4d15d76073b8472f98f5a044)
---
 ovn/northd/ovn-northd.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index ae09cf338..5d519c3f6 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -2503,12 +2503,11 @@ ovn_port_update_sbrec(struct northd_context *ctx,
 }
 
 if (sb_ha_ch_grp->n_ha_chassis != 1) {
-struct sbrec_ha_chassis **sb_ha_ch =
-xcalloc(1, sizeof *sb_ha_ch);
-sb_ha_ch[0] = create_sb_ha_chassis(ctx, chassis,
-   chassis->name, 0);
+struct sbrec_ha_chassis *sb_ha_ch =
+create_sb_ha_chassis(ctx, chassis,
+ chassis->name, 0);
 sbrec_ha_chassis_group_set_ha_chassis(sb_ha_ch_grp,
-  sb_ha_ch, 1);
+  _ha_ch, 1);
 }
 sbrec_port_binding_set_ha_chassis_group(op->sb,
 sb_ha_ch_grp);
-- 
2.21.0

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/1] Fixed memory leak in ovn-controller while handling port binding changes.

2019-08-06 Thread Numan Siddique
On Tue, Jul 23, 2019 at 4:47 PM Dumitru Ceara  wrote:

> On Tue, Jul 23, 2019 at 12:33 PM Damijan Skvarc 
> wrote:
> >
> > Signed-off-by: Damijan Skvarc 
>
> Looks good to me. Thanks!
> Acked-by: Dumitru Ceara 
>

Thank for the fix. I pushed this patch to ovn master.

We do need to backport this fix to branch 2.12.

Thanks
Numan


>
> > ---
> >  ovn/controller/physical.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c
> > index 316d373..7ad3e6f 100644
> > --- a/ovn/controller/physical.c
> > +++ b/ovn/controller/physical.c
> > @@ -1091,7 +1091,7 @@ void physical_handle_port_binding_changes(
> >flow_table, );
> >  }
> >  }
> > -
> > +ofpbuf_uninit();
> >  }
> >
> >  void
> > --
> > 2.7.4
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] memory leak in internal_dev_create

2019-08-06 Thread syzbot

Hello,

syzbot found the following crash on:

HEAD commit:1e78030e Merge tag 'mmc-v5.3-rc1' of git://git.kernel.org/..
git tree:   upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=148d3d1a60
kernel config:  https://syzkaller.appspot.com/x/.config?x=30cef20daf3e9977
dashboard link: https://syzkaller.appspot.com/bug?extid=13210896153522fe1ee5
compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=136aa8c460
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=109ba79260

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+13210896153522fe1...@syzkaller.appspotmail.com

BUG: memory leak
unreferenced object 0x8881207e4100 (size 128):
  comm "syz-executor032", pid 7014, jiffies 4294944027 (age 13.830s)
  hex dump (first 32 bytes):
00 70 16 18 81 88 ff ff 80 af 8c 22 81 88 ff ff  .p."
00 b6 23 17 81 88 ff ff 00 00 00 00 00 00 00 00  ..#.
  backtrace:
[<0eb78212>] kmemleak_alloc_recursive  
include/linux/kmemleak.h:43 [inline]

[<0eb78212>] slab_post_alloc_hook mm/slab.h:522 [inline]
[<0eb78212>] slab_alloc mm/slab.c:3319 [inline]
[<0eb78212>] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3548
[<006ea6c6>] kmalloc include/linux/slab.h:552 [inline]
[<006ea6c6>] kzalloc include/linux/slab.h:748 [inline]
[<006ea6c6>] ovs_vport_alloc+0x37/0xf0  
net/openvswitch/vport.c:130
[] internal_dev_create+0x24/0x1d0  
net/openvswitch/vport-internal_dev.c:164
[<56ee7c13>] ovs_vport_add+0x81/0x190  
net/openvswitch/vport.c:199

[<5434efc7>] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
[] ovs_dp_cmd_new+0x22f/0x410  
net/openvswitch/datapath.c:1614
[] genl_family_rcv_msg+0x2ab/0x5b0  
net/netlink/genetlink.c:629

[] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
[<6694b647>] netlink_rcv_skb+0x61/0x170  
net/netlink/af_netlink.c:2477

[<88381f37>] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
[] netlink_unicast_kernel  
net/netlink/af_netlink.c:1302 [inline]
[] netlink_unicast+0x1ec/0x2d0  
net/netlink/af_netlink.c:1328
[<67e6b079>] netlink_sendmsg+0x270/0x480  
net/netlink/af_netlink.c:1917

[] sock_sendmsg_nosec net/socket.c:637 [inline]
[] sock_sendmsg+0x54/0x70 net/socket.c:657
[<4cb7c11d>] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311
[] __sys_sendmsg+0x80/0xf0 net/socket.c:2356
[] __do_sys_sendmsg net/socket.c:2365 [inline]
[] __se_sys_sendmsg net/socket.c:2363 [inline]
[] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2363

BUG: memory leak
unreferenced object 0x88811723b600 (size 64):
  comm "syz-executor032", pid 7014, jiffies 4294944027 (age 13.830s)
  hex dump (first 32 bytes):
01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 02 00 00 00 05 35 82 c1  .5..
  backtrace:
[<352f46d8>] kmemleak_alloc_recursive  
include/linux/kmemleak.h:43 [inline]

[<352f46d8>] slab_post_alloc_hook mm/slab.h:522 [inline]
[<352f46d8>] slab_alloc mm/slab.c:3319 [inline]
[<352f46d8>] __do_kmalloc mm/slab.c:3653 [inline]
[<352f46d8>] __kmalloc+0x169/0x300 mm/slab.c:3664
[<8e48f3d1>] kmalloc include/linux/slab.h:557 [inline]
[<8e48f3d1>] ovs_vport_set_upcall_portids+0x54/0xd0  
net/openvswitch/vport.c:343
[<541e4f4a>] ovs_vport_alloc+0x7f/0xf0  
net/openvswitch/vport.c:139
[] internal_dev_create+0x24/0x1d0  
net/openvswitch/vport-internal_dev.c:164
[<56ee7c13>] ovs_vport_add+0x81/0x190  
net/openvswitch/vport.c:199

[<5434efc7>] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
[] ovs_dp_cmd_new+0x22f/0x410  
net/openvswitch/datapath.c:1614
[] genl_family_rcv_msg+0x2ab/0x5b0  
net/netlink/genetlink.c:629

[] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
[<6694b647>] netlink_rcv_skb+0x61/0x170  
net/netlink/af_netlink.c:2477

[<88381f37>] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
[] netlink_unicast_kernel  
net/netlink/af_netlink.c:1302 [inline]
[] netlink_unicast+0x1ec/0x2d0  
net/netlink/af_netlink.c:1328
[<67e6b079>] netlink_sendmsg+0x270/0x480  
net/netlink/af_netlink.c:1917

[] sock_sendmsg_nosec net/socket.c:637 [inline]
[] sock_sendmsg+0x54/0x70 net/socket.c:657
[<4cb7c11d>] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311

Re: [ovs-dev] [branch 2.12] ovn-controller: Encode the virtual port key in vport_bind action in network byte order

2019-08-06 Thread 0-day Robot
Bleep bloop.  Greetings Numan Siddique, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


git-am:
Failed to merge in the changes.
Patch failed at 0001 ovn-controller: Encode the virtual port key in vport_bind 
action in network byte order
The copy of the patch that failed is found in:
   
/var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


Please check this out.  If you feel there has been an error, please email 
acon...@bytheb.org

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Видеоуроки по школьным предметам: Математика, Русский, Английский, Химия, Физика, Биология, География, Природоведение, Словесность, Рисование, Рукоделие, Астрономия, Музыка. 13_05_2019 02_03

2019-08-06 Thread Роман Колунов via dev
ВИДЕОУРОКИ ПО ШКОЛЬНЫМ ПРЕДМЕТАМ
Математика, Русский, Английский, Химия, Физика, Биология, География, 
Природоведение, Словесность, Рисование, Рукоделие, Астрономия, Музыка.

Предлагаем вашему вниманию замечательные видеоуроки по школьным предметам, 
которые порадуют не только школьников, но и их педагогов, поскольку позволит 
повысить, а в некоторых случаях и привить интерес у детей к школьным предметам. 
Родителям поможет заранее подготовить своих детей к будущим предметам, что 
позволит им легче воспринимать школьную программу и повысит успеваемость. 
Великолепная возможность сэкономить на репетиторах в будущем или на развивающих 
уроках и кружках в настоящем, поскольку ребёнок сможет получить все те же самые 
знания, но в комфортных для него условиях, поскольку не нужно никуда ехать, 
договариваться с преподавателями и как следствие сохранит Вам много нервов 
времени и денег. Качество записи, работа преподавателей на высоком уровне, 
поэтому ребенок не перегружается второстепенной, а зачастую и ненужной в юном 
возрасте информацией. После изучения видеоуроков у ребёнка обязательно появятся 
новые увлечения и интересы. Данные видеоуроки рассчитаны для детей младшего 
школьного возраста. Наша коллекция послужит прекрасным подарком, не лишайте 
своих близких такого удовольствия.

МАТЕМАТИКА. Уроки математики в школе — одни из самых сложных, но авторы сделали 
всё, чтобы они стали одними из самых интересных учебных предметов. Как 
докопаться до квадратного корня, кто придумал магический квадрат и как решать 
уравнения с двумя неизвестными — вам расскажут на своих еженедельных уроках 
математики профессора Академии Круглов и Разумник. Даже неизменные помощники — 
хомяки Циркуль и Синус — готовы целыми днями решать математические задачи. Вам 
тоже понравится!

РУССКИЙ ЯЗЫК. Зачем изучать язык, который мы, казалось бы, и так знаем? На этот 
вопрос ответит на уроках Василиса, учительница русского языка. Оказывается, 
узнавать родной язык очень интересно! А начинается он с букв — у каждой свой 
характер, свой нрав. Удивительные истории о словах-перевёртышах и 
словах-близнецах ждут тех, кто усвоит азбуку. Уроки русского языка проходят в 
игровой форме, скучно на них не бывает!

АНГЛИЙСКИЙ ЯЗЫК. Один из трудных, но очень важных предметов, без знания 
которого в современном мире, как говорится просто никуда. Не смотря на все 
трудности, детям он нравится потому, что интересно узнавать новые слова и 
фразы, сравнивать их с нашими словами, узнавать новое и находить различия. 
Кроме того, можно разговаривать на другом языке, не на русском, а на 
английском, можно играть в разные интересные игры, петь весёлые английские 
песенки, узнавать много нового об Англии и людях, которые там живут. И вообще, 
зная английский язык, можно свободно путешествовать по миру и общаться с людьми 
из других стран. Вот почему детям нравятся уроки английского языка.

ХИМИЯ. Наука о превращениях, но без использования волшебной палочки! Убедиться 
в этом помогут профессор Дмитрий Иванович и его верный помощник Аргентум, он же 
Гоша. В основе многих выпусков передач лежат ответы на вопросы из писем 
любознательных зрителей. Какие химические реакции происходят у нас на кухне? 
Каково происхождение названий элементов в таблице Менделеева? Какое вещество 
находится внутри барометра? Для чего использовали серебро при получении 
фотографического снимка? Что представляет собой зеркало? Кто придумал спички? 
Почему темнеет медь? С помощью какого химического вещества можно повысить 
сопротивляемость организма инфекциям? Весёлые занятия позволят узнать 
удивительные вещи.

ФИЗИКА. Почему Земля имеет форму шара? Существует ли вечный двигатель? Можно ли 
самому изготовить лупу? Где можно услышать эхо и с какой скоростью движется 
звук? Как образуется радуга? Почему не падает самолет и не тонет корабль? 
Почему космонавты не чувствуют веса собственного тела? Оказывается, всё 
загадочное легко объяснимо — надо только выучить основные законы физики, тем 
более что они довольно просты. В этом совершенно уверен профессор Даниил 
Эдисонович Кварк, и на каждом уроке занимательной физики он убеждает в этом 
своих юных зрителей и корреспондентов. Влюблённый в свою замечательную науку, 
он готов рассказывать о ней до тех пор, пока найдётся хоть один слушатель. А их 
становится всё больше и больше — ведь профессор не читает лекций, а 
рассказывает ребятам о тех явлениях, с которыми столкнулись они сами, но не 
смогли понять.

БИОЛОГИЯ. Биос — с греческого означает «жизнь», а биология, следовательно, — 
наука о жизни во всех ее проявлениях. А проявления эти, надо сказать, порой до 
того необычны, что о них непременно хочется кого-нибудь расспросить. Почему 
растения любят слушать музыку? Чем отличаются цветы из сада от тех, что живут 
на подоконнике? Умеют ли животные притворяться? Ответы на эти и многие другие 
вопросы можно получить на уроках биологии у деятельной и энергичной Анны 
Семёновны Бабочкиной, профессора биологии.

ГЕОГРАФИЯ. Знаете ли вы, что 

[ovs-dev] [branch 2.12] ovn-controller: Encode the virtual port key in vport_bind action in network byte order

2019-08-06 Thread nusiddiq
From: Numan Siddique 

The commit [1] encoded the vport key using uint32_t and the test case
"action parsing" is failing for s380 arch.

This patch fixes this issue by encoding the vport key in the network byte
order.

[1] - 054f4c85c413("Add a new logical switch port type - 'virtual'")
Fixes: 054f4c85c413("Add a new logical switch port type - 'virtual'")

Signed-off-by: Numan Siddique 
Signed-off-by: Numan Siddique 
Acked-by: Dumitru Ceara 
Signed-off-by: Mark Michelson 

(cherry-picked from ovn commit - 3c39d7e21f6c24acfc9f934ee01263fa0dc3)
---
 ovn/controller/pinctrl.c | 11 ++-
 ovn/lib/actions.c|  3 ++-
 tests/ovn.at |  2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index 357050eb5..e443449f5 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -4489,16 +4489,17 @@ pinctrl_handle_bind_vport(
 uint32_t vport_parent_key = md->regs[MFF_LOG_INPORT - MFF_REG0];
 
 /* Get the virtual port key from the userdata buffer. */
-uint32_t *vport_key = ofpbuf_try_pull(userdata, sizeof *vport_key);
+ovs_be32 *vp_key = ofpbuf_try_pull(userdata, sizeof *vp_key);
 
-if (!vport_key) {
+if (!vp_key) {
 return;
 }
 
-uint32_t hash = hash_2words(dp_key, *vport_key);
+uint32_t vport_key = ntohl(*vp_key);
+uint32_t hash = hash_2words(dp_key, vport_key);
 
 struct put_vport_binding *vpb
-= pinctrl_find_put_vport_binding(dp_key, *vport_key, hash);
+= pinctrl_find_put_vport_binding(dp_key, vport_key, hash);
 if (!vpb) {
 if (hmap_count(_vport_bindings) >= 1000) {
 COVERAGE_INC(pinctrl_drop_put_vport_binding);
@@ -4510,7 +4511,7 @@ pinctrl_handle_bind_vport(
 }
 
 vpb->dp_key = dp_key;
-vpb->vport_key = *vport_key;
+vpb->vport_key = vport_key;
 vpb->vport_parent_key = vport_parent_key;
 
 notify_pinctrl_main();
diff --git a/ovn/lib/actions.c b/ovn/lib/actions.c
index 66916a837..b0cb3490b 100644
--- a/ovn/lib/actions.c
+++ b/ovn/lib/actions.c
@@ -2645,7 +2645,8 @@ encode_BIND_VPORT(const struct ovnact_bind_vport *vp,
 size_t oc_offset = encode_start_controller_op(ACTION_OPCODE_BIND_VPORT,
   false, NX_CTLR_NO_METER,
   ofpacts);
-ofpbuf_put(ofpacts, _key, sizeof(uint32_t));
+ovs_be32 vp_key = htonl(vport_key);
+ofpbuf_put(ofpacts, _key, sizeof(ovs_be32));
 encode_finish_controller_op(oc_offset, ofpacts);
 encode_restore_args(args, ARRAY_SIZE(args), ofpacts);
 }
diff --git a/tests/ovn.at b/tests/ovn.at
index 5d6c90c5f..92307c158 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -1371,7 +1371,7 @@ reg0[0] = check_pkt_larger(foo);
 # bind_vport
 # lsp1's port key is 0x11.
 bind_vport("lsp1", inport);
-encodes as controller(userdata=00.00.00.11.00.00.00.00.11.00.00.00)
+encodes as controller(userdata=00.00.00.11.00.00.00.00.00.00.00.11)
 # lsp2 doesn't exist. So it should be encoded as drop.
 bind_vport("lsp2", inport);
 encodes as drop
-- 
2.21.0

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev