[ovs-dev] FW:

2017-07-25 Thread Reno, Nitha
You Have been chosen for world heritage award






This message, including any attachments, is intended only for the use of the 
intended recipient(s), and it may contain privileged and confidential 
information. If you are not the intended recipient, you are hereby notified 
that any review, retransmission, conversion to hard copy, copying, circulation 
or other use of this message is strictly prohibited and may be illegal. If you 
are not the intended recipient, please notify me immediately by return e-mail, 
and delete this message from your system immediately.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] tc: Add SCTP support

2017-07-25 Thread Or Gerlitz

On 7/25/2017 8:29 AM, Roi Dayan wrote:

Imlement SCTP source and destination ports support for flower


s/Imlement/Implement also would be good to add a period @ the end of the 
sentence.


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


Re: [ovs-dev] Fwd: [PATCH] bond: Unify hash functions in hash action and entry lookup.

2017-07-25 Thread Ilya Maximets
On 24.07.2017 22:53, Andy Zhou wrote:
> On Mon, Jul 24, 2017 at 9:23 AM, Ilya Maximets  wrote:
>> On 23.07.2017 00:02, Darrell Ball wrote:
>>>
>>>
>>> -Original Message-
>>> From:  on behalf of Andy Zhou 
>>> 
>>> Date: Friday, July 21, 2017 at 2:17 PM
>>> To: "" 
>>> Subject: [ovs-dev] Fwd: [PATCH] bond: Unify hash functions in hash action   
>>>   and entry lookup.
>>>
>>> Add dev mailing list. It got dropped by accident.
>>>
>>>
>>> -- Forwarded message --
>>> From: Andy Zhou 
>>> Date: Fri, Jul 21, 2017 at 2:14 PM
>>> Subject: Re: [PATCH] bond: Unify hash functions in hash action and 
>>> entry lookup.
>>> To: Ilya Maximets 
>>>
>>>
>>> As it turns out, we can go even further:
>>>
>>> Notice that lookup_bond_entry() is only called with the code path of 
>>> BM_SLB.
>>> and bond_hash() is only called by lookup_bond_entry().
>>>
>>> I think we can just absorb the logic of lookup_bond_entry() into
>>> choose_output_slave()
>>> and remove bond_hash() all together.  What do you think?
>>>
>>>
>>> On Fri, Jul 21, 2017 at 1:06 PM, Andy Zhou  wrote:
>>> > On Fri, Jul 21, 2017 at 6:28 AM, Ilya Maximets 
>>>  wrote:
>>> >> 'lookup_bond_entry' currently uses 'flow_hash_symmetric_l4' while
>>> >> OVS_ACTION_ATTR_HASH uses 'flow_hash_5tuple'. This may lead to
>>> >> inconsistency in slave choosing for the new flows.  In general,
>>> >> there is no point to unify hash functions, because it's not
>>> >> required for correct work, but it's logically wrong to use
>>> >> different hash functions there.
>>> >>
>>> >> Unfortunately we're not able to use RSS hash here, because we have
>>> >> no packet at this point, but we may reduce inconsistency by using
>>> >> 'flow_hash_5tuple' instead of 'flow_hash_symmetric_l4' because
>>> >> symmetric quality is not needed.
>>> >>
>>> >> 'flow_hash_symmetric_l4' was used previously just because there
>>> >> was no other implemented hash function at the moment. Now we
>>> >> have 5tuple hash and may replace the old function.
>>>
>>> [Darrell]
>>>
>>> What other load balance option is available to do load balancing of L2 
>>> packets (non-IP)
>>> ‘at the same time’ as IPv4/6 packets for bonds ?
>>> Unless there is another, I am not sure giving up the load balancing of L2 
>>> packets is desirable.
>>> There would be a loss of feature functionality with this patch.
>>>
>>> A bond at a gateway (one of the most common use cases) could handle many CFM
>>> sessions, for example and dropping L2 fields from the hash sends all L2 
>>> packets to a
>>> single interface of a bond (single point of failure).
>>> The algorithm flow_hash_symmetric_l4 includes L2 fields (macs and vlans)
>>> in addition to IPv4/6 and L4 fields, which means it can load balance L2 
>>> packets (eg CFM)
>>> in addition to IPv4/6 packets.
>>>
>>> We have documented that L2 load balancing is included in balance-tcp, which 
>>> at the very
>>> least would need to change, assuming we thought such a change had more 
>>> advantages than disadvantages.
>>>
>>> http://openvswitch.org/support/dist-docs/ovs-vswitchd.conf.db.5.pdf
>>>
>>> “The following modes require the upstream switch to support 802.3ad with 
>>> successful LACP negotiation. If
>>> LACP negotiation fails and other-config:lacp-fallback-ab is true, then 
>>> active−backup mode is used:
>>>
>>>balance−tcp
>>> Balances flows among slaves based on L2, L3, and L4 
>>> protocol information such as destination
>>> MAC address, IP address, and TCP port.”
>>>
>>> What is the overall time cost savings in the scope of the whole code 
>>> pipeline for flow creation, not
>>> just the hash function itself (as mentioned in the commit message) ?
>>> This is not a per packet cost; it is per flow cost. Since this patch 
>>> removes feature content in lieu of
>>> some performance gain, I think it might be good to have some pipeline 
>>> performance measurements to
>>> make a decision whether it is worth it.
>>
>>
>> Looks like L2 fields is not used for balance-tcp bonding since
>> 4f150744921f ("dpif-netdev: Use miniflow as a flow key.").
>> Maybe this was changed by mistake, but 5tuple hash is used in
>> recirculation for the last 3 years.
>>
>> bond_hash_tcp(), actually, doesn't have any valuable effect on
>> flows distribution if recirculation supported. I think, we can
>> avoid using any type of hash inside base bonding code.
>> I'll check this additionally later.
>>
> 
> Agreed.
> 
>> And I think we need to fix the documentation to remove misleading
>> L2 mentioning.
> Yes, do you mind include the change in your series.

I'll include this in v2.

>>
>>> >>
>>> >> 'flow_hash_5tuple' is preferable solution because it in 2 - 8 times
>>> >> (depending on the flow) faster than symmetric function.
>>> >> So, this change will also speed up handling of the new flows and
>>

[ovs-dev] [PATCH v1] netdev-dpdk: Execute QoS Checking before copying to mbuf

2017-07-25 Thread Zhenyu Gao
In dpdk_do_tx_copy function, all packets were copied to mbuf first,
but QoS checking may drop some of them.
Move the QoS checking in front of copying data to mbuf, it helps to
reduce useless copy.

Signed-off-by: Zhenyu Gao 
---
 lib/netdev-dpdk.c | 55 ---
 1 file changed, 36 insertions(+), 19 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index ea17b97..bb8bd8f 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -258,7 +258,7 @@ struct dpdk_qos_ops {
  * For all QoS implementations it should always be non-null.
  */
 int (*qos_run)(struct qos_conf *qos_conf, struct rte_mbuf **pkts,
-   int pkt_cnt);
+   int pkt_cnt, bool may_steal);
 };
 
 /* dpdk_qos_ops for each type of user space QoS implementation */
@@ -1438,7 +1438,8 @@ netdev_dpdk_policer_pkt_handle(struct rte_meter_srtcm 
*meter,
 
 static int
 netdev_dpdk_policer_run(struct rte_meter_srtcm *meter,
-struct rte_mbuf **pkts, int pkt_cnt)
+struct rte_mbuf **pkts, int pkt_cnt,
+bool may_steal)
 {
 int i = 0;
 int cnt = 0;
@@ -1454,7 +1455,9 @@ netdev_dpdk_policer_run(struct rte_meter_srtcm *meter,
 }
 cnt++;
 } else {
-rte_pktmbuf_free(pkt);
+if (may_steal) {
+rte_pktmbuf_free(pkt);
+}
 }
 }
 
@@ -1463,12 +1466,13 @@ netdev_dpdk_policer_run(struct rte_meter_srtcm *meter,
 
 static int
 ingress_policer_run(struct ingress_policer *policer, struct rte_mbuf **pkts,
-int pkt_cnt)
+int pkt_cnt, bool may_steal)
 {
 int cnt = 0;
 
 rte_spinlock_lock(&policer->policer_lock);
-cnt = netdev_dpdk_policer_run(&policer->in_policer, pkts, pkt_cnt);
+cnt = netdev_dpdk_policer_run(&policer->in_policer, pkts,
+  pkt_cnt, may_steal);
 rte_spinlock_unlock(&policer->policer_lock);
 
 return cnt;
@@ -1572,7 +1576,7 @@ netdev_dpdk_vhost_rxq_recv(struct netdev_rxq *rxq,
 dropped = nb_rx;
 nb_rx = ingress_policer_run(policer,
 (struct rte_mbuf **) batch->packets,
-nb_rx);
+nb_rx, true);
 dropped -= nb_rx;
 }
 
@@ -1609,7 +1613,7 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq, struct 
dp_packet_batch *batch)
 dropped = nb_rx;
 nb_rx = ingress_policer_run(policer,
 (struct rte_mbuf **) batch->packets,
-nb_rx);
+nb_rx, true);
 dropped -= nb_rx;
 }
 
@@ -1627,13 +1631,13 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq, struct 
dp_packet_batch *batch)
 
 static inline int
 netdev_dpdk_qos_run(struct netdev_dpdk *dev, struct rte_mbuf **pkts,
-int cnt)
+int cnt, bool may_steal)
 {
 struct qos_conf *qos_conf = ovsrcu_get(struct qos_conf *, &dev->qos_conf);
 
 if (qos_conf) {
 rte_spinlock_lock(&qos_conf->lock);
-cnt = qos_conf->ops->qos_run(qos_conf, pkts, cnt);
+cnt = qos_conf->ops->qos_run(qos_conf, pkts, cnt, may_steal);
 rte_spinlock_unlock(&qos_conf->lock);
 }
 
@@ -1707,7 +1711,7 @@ __netdev_dpdk_vhost_send(struct netdev *netdev, int qid,
 
 cnt = netdev_dpdk_filter_packet_len(dev, cur_pkts, cnt);
 /* Check has QoS has been configured for the netdev */
-cnt = netdev_dpdk_qos_run(dev, cur_pkts, cnt);
+cnt = netdev_dpdk_qos_run(dev, cur_pkts, cnt, true);
 dropped = total_pkts - cnt;
 
 do {
@@ -1753,10 +1757,22 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid, struct 
dp_packet_batch *batch)
 #endif
 struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
 struct rte_mbuf *pkts[PKT_ARRAY_SIZE];
+int txcnt_eth = batch->count;
 int dropped = 0;
 int newcnt = 0;
 int i;
 
+if (dev->type != DPDK_DEV_VHOST) {
+/* Check if QoS has been configured for this netdev. */
+txcnt_eth = netdev_dpdk_qos_run(dev,
+(struct rte_mbuf **)batch->packets,
+txcnt_eth, false);
+if (txcnt_eth == 0) {
+dropped = batch->count;
+goto out;
+}
+}
+
 dp_packet_batch_apply_cutlen(batch);
 
 for (i = 0; i < batch->count; i++) {
@@ -1785,21 +1801,20 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid, struct 
dp_packet_batch *batch)
 rte_pktmbuf_pkt_len(pkts[newcnt]) = size;
 
 newcnt++;
+if (dev->type != DPDK_DEV_VHOST && newcnt >= txcnt_eth) {
+dropped += batch->count - i - 1;
+break;
+}
 }
 
 if (dev->type == DPDK_DEV_VHOST) {
 __netdev_dpdk_vhost_send(netdev, qid, (struct dp_packet **) pkts,
   

[ovs-dev] [PATCH v2 0/3] bond: Clean up hash functions.

2017-07-25 Thread Ilya Maximets
Version 2:
* Became a patch-set.
  v1: 
https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/336078.html
* Removed bond_hash_tcp.
* 2 new patches added:
* Documentation fix.
* Remove bond_hash_src.

Ilya Maximets (3):
  vswitch.xml: Fix L2 balancing mentioning for balance-tcp bond.
  bond: Unify hash functions in hash action and entry lookup.
  bond: Remove bond_hash_src.

 ofproto/bond.c   | 28 +++-
 vswitchd/vswitch.xml |  5 ++---
 2 files changed, 5 insertions(+), 28 deletions(-)

-- 
2.7.4

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


[ovs-dev] [PATCH v2 1/3] vswitch.xml: Fix L2 balancing mentioning for balance-tcp bond.

2017-07-25 Thread Ilya Maximets
L2 fields are not used in userspace hash action since
commit 4f150744921f ("dpif-netdev: Use miniflow as a flow key.").
In kernel datapath RSS (which is not include L2 by default for
most of the NICs) was used from the beginning. This means that
if recirculation is in use, L2 fields are not used for flow
balancing.

Fix the documentation accordingly.

Signed-off-by: Ilya Maximets 
---

I think, this should be applied to some stable branches too.

 vswitchd/vswitch.xml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 883ecd8..074535b 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1569,9 +1569,8 @@
   
 balance-tcp
 
-  Balances flows among slaves based on L2, L3, and L4 protocol
-  information such as destination MAC address, IP address, and TCP
-  port.
+  Balances flows among slaves based on L3 and L4 protocol information
+  such as IP addresses and TCP/UDP ports.
 
   
 
-- 
2.7.4

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


[ovs-dev] [PATCH v2 2/3] bond: Unify hash functions in hash action and entry lookup.

2017-07-25 Thread Ilya Maximets
'lookup_bond_entry' currently uses 'flow_hash_symmetric_l4' while
OVS_ACTION_ATTR_HASH uses 'flow_hash_5tuple'. This may lead to
inconsistency in slave choosing for the new flows.  In general,
there is no point to unify hash functions, because it's not
required for correct work, but it's logically wrong to use
different hash functions there.

Unfortunately we're not able to use RSS hash here, because we have
no packet at this point, but we may reduce inconsistency by using
'flow_hash_5tuple' instead of 'flow_hash_symmetric_l4' because
symmetric quality is not needed.

'flow_hash_symmetric_l4' was used previously just because there
was no other implemented hash function at the moment and L2
fields was additionally involved in hash calculation. Now we
have 5tuple hash and L2 not used anymore, so, we may replace the
old function.

'flow_hash_5tuple' is preferable solution because it in 2 - 8 times
(depending on the flow) faster than symmetric function.
So, this change will also speed up handling of the new flows and
statistics accounting.

Additionally function 'bond_hash_tcp()' was removed for the reasons
of code simplification and possible additional speed up.

Co-authored-by: Andy Zhou 
Signed-off-by: Andy Zhou 
Signed-off-by: Ilya Maximets 
---
 ofproto/bond.c | 16 +---
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index cb25a1d..e4d4b65 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -177,8 +177,6 @@ static void bond_choose_active_slave(struct bond *)
 OVS_REQ_WRLOCK(rwlock);
 static unsigned int bond_hash_src(const struct eth_addr mac,
   uint16_t vlan, uint32_t basis);
-static unsigned int bond_hash_tcp(const struct flow *, uint16_t vlan,
-  uint32_t basis);
 static struct bond_entry *lookup_bond_entry(const struct bond *,
 const struct flow *,
 uint16_t vlan)
@@ -1743,24 +1741,12 @@ bond_hash_src(const struct eth_addr mac, uint16_t vlan, 
uint32_t basis)
 }
 
 static unsigned int
-bond_hash_tcp(const struct flow *flow, uint16_t vlan, uint32_t basis)
-{
-struct flow hash_flow = *flow;
-hash_flow.vlans[0].tci = htons(vlan);
-
-/* The symmetric quality of this hash function is not required, but
- * flow_hash_symmetric_l4 already exists, and is sufficient for our
- * purposes, so we use it out of convenience. */
-return flow_hash_symmetric_l4(&hash_flow, basis);
-}
-
-static unsigned int
 bond_hash(const struct bond *bond, const struct flow *flow, uint16_t vlan)
 {
 ovs_assert(bond->balance == BM_TCP || bond->balance == BM_SLB);
 
 return (bond->balance == BM_TCP
-? bond_hash_tcp(flow, vlan, bond->basis)
+? flow_hash_5tuple(flow, bond->basis)
 : bond_hash_src(flow->dl_src, vlan, bond->basis));
 }
 
-- 
2.7.4

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


[ovs-dev] [PATCH v2 3/3] bond: Remove bond_hash_src.

2017-07-25 Thread Ilya Maximets
Since introduction of 'hash_mac()' function in
commit 7e36ac42e33a ("lib/packet.h: add hash_mac()"), there is no
need to have additional wrapper for mac address hashing.

Lets use 'hash_mac()' directly and remove 'bond_hash_src()' to
simplify the code.

Suggested-by: Andy Zhou 
Signed-off-by: Ilya Maximets 
---
 ofproto/bond.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index e4d4b65..e09136e 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -175,8 +175,6 @@ static void bond_link_status_update(struct bond_slave *)
 OVS_REQ_WRLOCK(rwlock);
 static void bond_choose_active_slave(struct bond *)
 OVS_REQ_WRLOCK(rwlock);
-static unsigned int bond_hash_src(const struct eth_addr mac,
-  uint16_t vlan, uint32_t basis);
 static struct bond_entry *lookup_bond_entry(const struct bond *,
 const struct flow *,
 uint16_t vlan)
@@ -1615,7 +1613,7 @@ bond_unixctl_hash(struct unixctl_conn *conn, int argc, 
const char *argv[],
 }
 
 if (ovs_scan(mac_s, ETH_ADDR_SCAN_FMT, ETH_ADDR_SCAN_ARGS(mac))) {
-hash = bond_hash_src(mac, vlan, basis) & BOND_MASK;
+hash = hash_mac(mac, vlan, basis) & BOND_MASK;
 
 hash_cstr = xasprintf("%u", hash);
 unixctl_command_reply(conn, hash_cstr);
@@ -1735,19 +1733,13 @@ bond_link_status_update(struct bond_slave *slave)
 }
 
 static unsigned int
-bond_hash_src(const struct eth_addr mac, uint16_t vlan, uint32_t basis)
-{
-return hash_mac(mac, vlan, basis);
-}
-
-static unsigned int
 bond_hash(const struct bond *bond, const struct flow *flow, uint16_t vlan)
 {
 ovs_assert(bond->balance == BM_TCP || bond->balance == BM_SLB);
 
 return (bond->balance == BM_TCP
 ? flow_hash_5tuple(flow, bond->basis)
-: bond_hash_src(flow->dl_src, vlan, bond->basis));
+: hash_mac(flow->dl_src, vlan, bond->basis));
 }
 
 static struct bond_entry *
-- 
2.7.4

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


Re: [ovs-dev] [PATCH] tc: Add SCTP support

2017-07-25 Thread Roi Dayan



On 25/07/2017 12:25, Or Gerlitz wrote:

On 7/25/2017 8:29 AM, Roi Dayan wrote:

Imlement SCTP source and destination ports support for flower


s/Imlement/Implement also would be good to add a period @ the end of the
sentence.


bummer i actually saw that in our internal review but somehow sent
without the update.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] (no subject)

2017-07-25 Thread Barry Stone



Brauchen Sie einen Kredit?

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


[ovs-dev] [PATCH V2] tc: Add SCTP support

2017-07-25 Thread Roi Dayan
From: Vlad Buslov 

Implement SCTP source and destination ports support for flower.

Signed-off-by: Vlad Buslov 
Reviewed-by: Paul Blakey 
Acked-by: Roi Dayan 
---

V1->V2
- Fix typo in commit message.


 lib/netdev-tc-offloads.c |  4 +++-
 lib/tc.c | 26 ++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
index c98c259..318e030 100644
--- a/lib/netdev-tc-offloads.c
+++ b/lib/netdev-tc-offloads.c
@@ -748,7 +748,9 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 flower.key.ip_proto = key->nw_proto;
 flower.mask.ip_proto = mask->nw_proto;
 
-if (key->nw_proto == IPPROTO_TCP || key->nw_proto == IPPROTO_UDP) {
+if (key->nw_proto == IPPROTO_TCP
+|| key->nw_proto == IPPROTO_UDP
+|| key->nw_proto == IPPROTO_SCTP) {
 flower.key.dst_port = key->tp_dst;
 flower.mask.dst_port = mask->tp_dst;
 flower.key.src_port = key->tp_src;
diff --git a/lib/tc.c b/lib/tc.c
index 401690e..82c5ee7 100644
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -167,6 +167,10 @@ static const struct nl_policy tca_flower_policy[] = {
 [TCA_FLOWER_KEY_UDP_DST] = { .type = NL_A_U16, .optional = true, },
 [TCA_FLOWER_KEY_UDP_SRC_MASK] = { .type = NL_A_U16, .optional = true, },
 [TCA_FLOWER_KEY_UDP_DST_MASK] = { .type = NL_A_U16, .optional = true, },
+[TCA_FLOWER_KEY_SCTP_SRC] = { .type = NL_A_U16, .optional = true, },
+[TCA_FLOWER_KEY_SCTP_DST] = { .type = NL_A_U16, .optional = true, },
+[TCA_FLOWER_KEY_SCTP_SRC_MASK] = { .type = NL_A_U16, .optional = true, },
+[TCA_FLOWER_KEY_SCTP_DST_MASK] = { .type = NL_A_U16, .optional = true, },
 [TCA_FLOWER_KEY_VLAN_ID] = { .type = NL_A_U16, .optional = true, },
 [TCA_FLOWER_KEY_VLAN_PRIO] = { .type = NL_A_U8, .optional = true, },
 [TCA_FLOWER_KEY_VLAN_ETH_TYPE] = { .type = NL_A_U16, .optional = true, },
@@ -327,6 +331,17 @@ nl_parse_flower_ip(struct nlattr **attrs, struct tc_flower 
*flower) {
 mask->dst_port =
 nl_attr_get_be16(attrs[TCA_FLOWER_KEY_UDP_DST_MASK]);
 }
+} else if (ip_proto == IPPROTO_SCTP) {
+if (attrs[TCA_FLOWER_KEY_SCTP_SRC_MASK]) {
+key->src_port = nl_attr_get_be16(attrs[TCA_FLOWER_KEY_SCTP_SRC]);
+mask->src_port =
+nl_attr_get_be16(attrs[TCA_FLOWER_KEY_SCTP_SRC_MASK]);
+}
+if (attrs[TCA_FLOWER_KEY_SCTP_DST_MASK]) {
+key->dst_port = nl_attr_get_be16(attrs[TCA_FLOWER_KEY_SCTP_DST]);
+mask->dst_port =
+nl_attr_get_be16(attrs[TCA_FLOWER_KEY_SCTP_DST_MASK]);
+}
 }
 }
 
@@ -1020,6 +1035,17 @@ nl_msg_put_flower_options(struct ofpbuf *request, struct 
tc_flower *flower)
 TCA_FLOWER_KEY_TCP_DST_MASK,
 &flower->key.dst_port,
 &flower->mask.dst_port, 2);
+} else if (flower->key.ip_proto == IPPROTO_SCTP) {
+nl_msg_put_masked_value(request,
+TCA_FLOWER_KEY_SCTP_SRC,
+TCA_FLOWER_KEY_SCTP_SRC_MASK,
+&flower->key.src_port,
+&flower->mask.src_port, 2);
+nl_msg_put_masked_value(request,
+TCA_FLOWER_KEY_SCTP_DST,
+TCA_FLOWER_KEY_SCTP_DST_MASK,
+&flower->key.dst_port,
+&flower->mask.dst_port, 2);
 }
 }
 
-- 
2.7.4

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


Re: [ovs-dev] [PATCH v3 1/3] ovn util: Refactor dhcp_opts_map to make it generic

2017-07-25 Thread Miguel Angel Ajo Pelayo
Looks good to my unexperienced eyes.

Acked-by: Miguel Angel Ajo 

On Fri, Jul 14, 2017 at 2:25 PM,  wrote:

> From: Numan Siddique 
>
> Renamed 'struct dhcp_opts_map' to 'struct gen_opts_map' and
> renamed ovn-dhcp.h to ovn-l7.h. An upcoming commit to support IPv6
> Router Advertisement, will make use of the refactored code to store
> the IPv6 ND RA options in 'struct gen_opts_map'.
>
> Signed-off-by: Numan Siddique 
> ---
>  include/ovn/actions.h|  16 +++
>  ovn/controller/lflow.c   |   2 +-
>  ovn/controller/pinctrl.c |   2 +-
>  ovn/lib/actions.c| 100 ++
> -
>  ovn/lib/automake.mk  |   2 +-
>  ovn/lib/{ovn-dhcp.h => ovn-l7.h} |  67 ++
>  ovn/northd/ovn-northd.c  |  14 +++---
>  ovn/utilities/ovn-trace.c|  10 ++--
>  tests/test-ovn.c |   3 +-
>  9 files changed, 127 insertions(+), 89 deletions(-)
>  rename ovn/lib/{ovn-dhcp.h => ovn-l7.h} (78%)
>
> diff --git a/include/ovn/actions.h b/include/ovn/actions.h
> index 9e4a5c5ab..de55d88c7 100644
> --- a/include/ovn/actions.h
> +++ b/include/ovn/actions.h
> @@ -68,8 +68,8 @@ struct simap;
>  OVNACT(PUT_ARP,   ovnact_put_mac_bind)  \
>  OVNACT(GET_ND,ovnact_get_mac_bind)  \
>  OVNACT(PUT_ND,ovnact_put_mac_bind)  \
> -OVNACT(PUT_DHCPV4_OPTS, ovnact_put_dhcp_opts)   \
> -OVNACT(PUT_DHCPV6_OPTS, ovnact_put_dhcp_opts)   \
> +OVNACT(PUT_DHCPV4_OPTS, ovnact_put_opts)   \
> +OVNACT(PUT_DHCPV6_OPTS, ovnact_put_opts)   \
>  OVNACT(SET_QUEUE,   ovnact_set_queue)   \
>  OVNACT(DNS_LOOKUP,  ovnact_dns_lookup)
>
> @@ -233,16 +233,16 @@ struct ovnact_put_mac_bind {
>  struct expr_field mac;  /* 48-bit Ethernet address. */
>  };
>
> -struct ovnact_dhcp_option {
> -const struct dhcp_opts_map *option;
> +struct ovnact_gen_option {
> +const struct gen_opts_map *option;
>  struct expr_constant_set value;
>  };
>
>  /* OVNACT_PUT_DHCPV4_OPTS, OVNACT_PUT_DHCPV6_OPTS. */
> -struct ovnact_put_dhcp_opts {
> +struct ovnact_put_opts {
>  struct ovnact ovnact;
>  struct expr_field dst;  /* 1-bit destination field. */
> -struct ovnact_dhcp_option *options;
> +struct ovnact_gen_option *options;
>  size_t n_options;
>  };
>
> @@ -414,10 +414,10 @@ struct ovnact_parse_params {
>   * expr_parse()). */
>  const struct shash *symtab;
>
> -/* hmap of 'struct dhcp_opts_map' to support 'put_dhcp_opts' action */
> +/* hmap of 'struct gen_opts_map' to support 'put_dhcp_opts' action */
>  const struct hmap *dhcp_opts;
>
> -/* hmap of 'struct dhcp_opts_map'  to support 'put_dhcpv6_opts'
> action */
> +/* hmap of 'struct gen_opts_map'  to support 'put_dhcpv6_opts' action
> */
>  const struct hmap *dhcpv6_opts;
>
>  /* Each OVN flow exists in a logical table within a logical pipeline.
> diff --git a/ovn/controller/lflow.c b/ovn/controller/lflow.c
> index b1b4b2372..c4fe5f9eb 100644
> --- a/ovn/controller/lflow.c
> +++ b/ovn/controller/lflow.c
> @@ -24,7 +24,7 @@
>  #include "ovn-controller.h"
>  #include "ovn/actions.h"
>  #include "ovn/expr.h"
> -#include "ovn/lib/ovn-dhcp.h"
> +#include "ovn/lib/ovn-l7.h"
>  #include "ovn/lib/ovn-sb-idl.h"
>  #include "packets.h"
>  #include "physical.h"
> diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
> index 660233a09..723966924 100644
> --- a/ovn/controller/pinctrl.c
> +++ b/ovn/controller/pinctrl.c
> @@ -39,7 +39,7 @@
>  #include "ovn/actions.h"
>  #include "ovn/lex.h"
>  #include "ovn/lib/logical-fields.h"
> -#include "ovn/lib/ovn-dhcp.h"
> +#include "ovn/lib/ovn-l7.h"
>  #include "ovn/lib/ovn-util.h"
>  #include "poll-loop.h"
>  #include "rconn.h"
> diff --git a/ovn/lib/actions.c b/ovn/lib/actions.c
> index 937f94d80..be821650d 100644
> --- a/ovn/lib/actions.c
> +++ b/ovn/lib/actions.c
> @@ -20,7 +20,7 @@
>  #include "bitmap.h"
>  #include "byte-order.h"
>  #include "compiler.h"
> -#include "ovn-dhcp.h"
> +#include "ovn-l7.h"
>  #include "hash.h"
>  #include "logical-fields.h"
>  #include "nx-match.h"
> @@ -1373,19 +1373,17 @@ ovnact_put_mac_bind_free(struct
> ovnact_put_mac_bind *put_mac OVS_UNUSED)
>  }
>
>  static void
> -parse_dhcp_opt(struct action_context *ctx, struct ovnact_dhcp_option *o,
> -   bool v6)
> +parse_gen_opt(struct action_context *ctx, struct ovnact_gen_option *o,
> +  const struct hmap *gen_opts, const char *opts_type)
>  {
>  if (ctx->lexer->token.type != LEX_T_ID) {
>  lexer_syntax_error(ctx->lexer, NULL);
>  return;
>  }
>
> -const char *name = v6 ? "DHCPv6" : "DHCPv4";
> -const struct hmap *map = v6 ? ctx->pp->dhcpv6_opts :
> ctx->pp->dhcp_opts;
> -o->option = map ? dhcp_opts_find(map, ctx->lexer->token.s) : NULL;
> +o->option = gen_opts ? gen_opts_find(gen_opts, ctx->lexer->token.s) :
> NULL;
>  if (!o->option) {
> -lexer_syntax_error(c

Re: [ovs-dev] [PATCH v3] Update relevant artifacts to add support for DPDK 17.05.1.

2017-07-25 Thread Weglicki, MichalX
Hi All, 

VHOST Client reconnection also works without any problems. 
Suggested documentation changes will be part of v4 patch which will be 
available shortly. 

Br, 
Michal. 

> -Original Message-
> From: Stokes, Ian
> Sent: Monday, July 24, 2017 7:15 PM
> To: Darrell Ball ; Kevin Traynor ; 
> Weglicki, MichalX ;
> d...@openvswitch.org
> Subject: RE: [ovs-dev] [PATCH v3] Update relevant artifacts to add support 
> for DPDK 17.05.1.
> 
> > On 7/19/17, 9:40 AM, "ovs-dev-boun...@openvswitch.org on behalf of Kevin
> > Traynor"  > ktray...@redhat.com> wrote:
> >
> > On 07/19/2017 10:30 AM, Michal Weglicki wrote:
> > > Upgrading to DPDK 17.05.1 stable release adds new
> > > significant features relevant to OVS, including,
> > > but not limited to:
> > > - tun/tap PMD,
> > > - VFIO hotplug support,
> > > - Generic flow API.
> > >
> > > Following changes are applied:
> > > - netdev-dpdk: Changes required by DPDK API modifications.
> > > - doc: Because of DPDK API changes, backward compatibility
> > >   with previous DPDK releases will be broken, thus all
> > >   relevant documentation entries are updated.
> > > - .travis: DPDK version change from 16.11.1 to 17.05.1.
> > > - rhel/openvswitch-fedora.spec.in: DPDK version change
> > >   from 16.11 to 17.05.1
> > >
> >
> > Hi Michal, were you able to check vhost features like multi-queue and
> > vhostclient reconnect are still working ok with this patch?
> Hi All,
> 
> I've tested the vhost multi queue aspect of this patch today and I found no 
> issues with it.
> 
> Thanks
> Ian
> >
> > Few comments on the docs below.
> >
> > > v1->v2: Patch rebase.
> > > v2->v3: Fixed wrong formating after v2 patch rebase.
> > >
> > > Signed-off-by: Michal Weglicki 
> > > Reviewed-by: Aaron Conole 
> > > ---
> > >  .travis/linux-build.sh   |   2 +-
> > >  Documentation/intro/install/dpdk.rst |   8 +-
> > >  Documentation/topics/dpdk/vhost-user.rst |   8 +-
> > >  NEWS |   1 +
> > >  lib/netdev-dpdk.c| 144 +++-
> > ---
> > >  rhel/openvswitch-fedora.spec.in  |   2 +-
> > >  tests/dpdk/ring_client.c |   6 +-
> > >  7 files changed, 105 insertions(+), 66 deletions(-)
> > >
> > > diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> > > index f66b534..efccdf1 100755
> > > --- a/.travis/linux-build.sh
> > > +++ b/.travis/linux-build.sh
> > > @@ -80,7 +80,7 @@ fi
> > >
> > >  if [ "$DPDK" ]; then
> > >  if [ -z "$DPDK_VER" ]; then
> > > -DPDK_VER="16.11.2"
> > > +DPDK_VER="17.05.1"
> > >  fi
> > >  install_dpdk $DPDK_VER
> > >  if [ "$CC" = "clang" ]; then
> > > diff --git a/Documentation/intro/install/dpdk.rst
> > b/Documentation/intro/install/dpdk.rst
> > > index a05aa1a..4a178f3 100644
> > > --- a/Documentation/intro/install/dpdk.rst
> > > +++ b/Documentation/intro/install/dpdk.rst
> > > @@ -40,7 +40,7 @@ Build requirements
> > >  In addition to the requirements described in :doc:`general`,
> > building Open
> > >  vSwitch with DPDK will require the following:
> > >
> > > -- DPDK 16.11
> > > +- DPDK 17.05.1
> > >
> > >  - A `DPDK supported NIC`_
> > >
> > > @@ -69,9 +69,9 @@ Install DPDK
> > >  #. Download the `DPDK sources`_, extract the file and set
> > ``DPDK_DIR``::
> > >
> > > $ cd /usr/src/
> > > -   $ wget https://urldefense.proofpoint.com/v2/url?u=http-
> > 3A__fast.dpdk.org_rel_dpdk-
> > 2D16.11.2.tar.xz&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-
> > uZnsw&m=k97jBbskm5qtu47B5YEDKLa6LCgJq7IpV9fRXIASszk&s=VXewRbmVuHTeOAdaJZA9
> > ivHiJCZFh617b1ay74Fjhqs&e=
> > > -   $ tar xf dpdk-16.11.2.tar.xz
> > > -   $ export DPDK_DIR=/usr/src/dpdk-stable-16.11.2
> > > +   $ wget https://urldefense.proofpoint.com/v2/url?u=http-
> > 3A__fast.dpdk.org_rel_dpdk-
> > 2D17.05.1.tar.xz&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-
> > uZnsw&m=k97jBbskm5qtu47B5YEDKLa6LCgJq7IpV9fRXIASszk&s=2ExT20R-
> > aUXe1Fm7vJWI1NTBBseyM6Tyz3youB2btL8&e=
> > > +   $ tar xf dpdk-17.05.1.tar.xz
> > > +   $ export DPDK_DIR=/usr/src/dpdk-stable-17.05.1
> > > $ cd $DPDK_DIR
> > >
> > >  #. (Optional) Configure DPDK as a shared library
> >
> > There is a reference to DPDK16.11 release notes at the end of this
> > file
> >
> > > diff --git a/Documentation/topics/dpdk/vhost-user.rst
> > b/Documentation/topics/dpdk/vhost-user.rst
> > > index e76da5f..9f11ea1 100644
> > > --- a/Documentation/topics/dpdk/vhost-user.rst
> > > +++ b/Documentation/topics/dpdk/vhost-user.rst
> > > @@ -292,9 +292,9 @@ To begin, instantiate a guest as described in
> > :ref:`dpdk-vhost-user` or
> >  

Re: [ovs-dev] [PATCH v3 3/3] ovn-northd: Add logical flows to support native IPv6 RA

2017-07-25 Thread Miguel Angel Ajo Pelayo
Looks good, just a tiny comment, but not actually very important.


On Fri, Jul 14, 2017 at 2:26 PM,  wrote:

> From: Zongkai LI 
>
> This patch adds logical flows which sends IPv6 Router Advertisement
> packet in response to the IPv6 Router Solicitation request. It uses
> the actions "put_nd_ra_opts" to transform the RS packet to RA packet
> in the newly added ingress stage "lr_in_nd_ra_options" in router
> pipeline. If the action "put_nd_ra_opts" is successful, it sends the
> RA packet back to the originating port in the next ingress stage
> "lr_in_nd_ra_response".
>
> A new column "ipv6_ra_configs" is added in the Logical_Router_Port
> table, which the CMS is expected to configure IPv6 RA
> configurations - "address_mode" and "mtu" for adding these flows.
>
> Co-authored-by: Numan Siddique 
> Signed-off-by: Zongkai LI 
> Signed-off-by: Numan Siddique 
> ---
>  ovn/lib/logical-fields.c|   4 +
>  ovn/northd/ovn-northd.8.xml |  81 ++-
>  ovn/northd/ovn-northd.c | 129 
>  ovn/ovn-nb.ovsschema|   7 +-
>  ovn/ovn-nb.xml  |  39 
>  ovn/ovn-sb.xml  |   4 +
>  tests/ovn.at| 237 ++
> ++
>  7 files changed, 478 insertions(+), 23 deletions(-)
>
> diff --git a/ovn/lib/logical-fields.c b/ovn/lib/logical-fields.c
> index 26e336f5a..a8b5e3c51 100644
> --- a/ovn/lib/logical-fields.c
> +++ b/ovn/lib/logical-fields.c
> @@ -183,6 +183,10 @@ ovn_init_symtab(struct shash *symtab)
>"icmp6.type == 135 && icmp6.code == 0 && ip.ttl == 255");
>  expr_symtab_add_predicate(symtab, "nd_na",
>"icmp6.type == 136 && icmp6.code == 0 && ip.ttl == 255");
> +expr_symtab_add_predicate(symtab, "nd_rs",
> +  "icmp6.type == 133 && icmp6.code == 0 && ip.ttl == 255");
> +expr_symtab_add_predicate(symtab, "nd_ra",
> +  "icmp6.type == 134 && icmp6.code == 0 && ip.ttl == 255");
>  expr_symtab_add_field(symtab, "nd.target", MFF_ND_TARGET, "nd",
> false);
>  expr_symtab_add_field(symtab, "nd.sll", MFF_ND_SLL, "nd_ns", false);
>  expr_symtab_add_field(symtab, "nd.tll", MFF_ND_TLL, "nd_na", false);
> diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
> index 7ff524508..911f67b21 100644
> --- a/ovn/northd/ovn-northd.8.xml
> +++ b/ovn/northd/ovn-northd.8.xml
> @@ -1573,7 +1573,80 @@ icmp4 {
>
>  
>
> -Ingress Table 5: IP Routing
> +Ingress Table 5: IPv6 ND RA option processing
> +
> +
> +  
> +
> +  A priority-50 logical flow is added for each logical router port
> +  configured with IPv6 ND RA options which matches IPv6 ND Router
> +  Solicitation packet and applies the action
> +  put_nd_ra_opts and advances the packet to the next
> +  table.
> +
> +
> +
> +reg0[5] = put_nd_ra_opts(options);next;
> +
> +
> +
> +  For a valid IPv6 ND RS packet, this transforms the packet into
> an
> +  IPv6 ND RA reply and sets the RA options to the packet and
> stores 1
> +  into reg0[5]. For other kinds of packets, it just stores 0 into
> +  reg0[5]. Either way, it continues to the next table.
> +
> +  
> +
> +  
> +A priority-0 logical flow with match 1 has actions
> +next;.
> +  
> +
> +
> +Ingress Table 6: IPv6 ND RA responder
> +
> +
> +  This table implements IPv6 ND RA responder for the IPv6 ND RA
> replies
> +  generated by the previous table.
> +
> +
> +
> +  
> +
> +  A priority-50 logical flow is added for each logical router port
> +  configured with IPv6 ND RA options which matches IPv6 ND RA
> +  packets and reg0[5] == 1 and responds back to the
> +  inport after applying these actions.
> +  If reg0[5] is set to 1, it means that the action
> +  put_nd_ra_opts was successful.
> +
> +
> +
> +eth.src = E;
> +ip6.src = I;
> +outport = P;
> +flags.loopback = 1;
> +output;
> +
> +
> +
> +  where E is the MAC address and I is the
> IPv6
> +  link local address of the logical router port.
> +
> +
> +
> +  (This terminates packet processing in ingress pipeline; the
> packet
> +  does not go to the next ingress table.)
> +
> +  
> +
> +  
> +A priority-0 logical flow with match 1 has actions
> +next;.
> +  
> +
> +
> +Ingress Table 7: IP Routing
>
>  
>A packet that arrives at this table is an IP packet that should be
> @@ -1675,7 +1748,7 @@ next;
>
>  
>
> -Ingress Table 6: ARP/ND Resolution
> +Ingress Table 8: ARP/ND Resolution
>
>  
>Any packet that reaches this table is an IP packet whose next-hop
> @@ -1768,7 +1841,7 @@ next;
>
>  
>
> -Ingress Table 7: Gateway Redirect
> +Ingress 

Re: [ovs-dev] [PATCH v3 2/3] ovn-controller: Add a new action - 'put_nd_ra_opts'

2017-07-25 Thread Miguel Angel Ajo Pelayo
Looks good to my unexperienced eye.

Acked-by: Miguel Angel Ajo 

On Fri, Jul 14, 2017 at 2:26 PM,  wrote:

> From: Numan Siddique 
>
> This patch adds a new OVN action 'put_nd_ra_opts' to support native
> IPv6 Router Advertisement in OVN. This action can be used to respond
> to the IPv6 Router Solicitation requests.
>
> ovn-controller parses this action and adds a NXT_PACKET_IN2 OF flow
> with 'pause' flag set and the RA options stored in 'userdata' field.
> This action is similar to 'put_dhcp_opts' and 'put_dhcpv6_opts'.
>
> When a valid IPv6 RS packet is received by the pinctrl module of
> ovn-controller, it frames a new RA packet and sets the RA options
> from the 'userdata' field and resumes the packet storing 1 in the
> 1-bit result sub-field. If the packet is invalid, it resumes the
> packet without any modifications storing 0 in the 1-bit result
> sub-field.
>
> Eg. reg0[5] = put_nd_ra_opts(address_mode = "slaac", mtu = 1450,
>  slla = 01:02:03:04:05:06, prefix = aef0::/64)
>
> Note that unlike DHCPv4/v6, a new table to store the supported IPv6 ND RA
> options is not added in SB DB since there are only 3 ND RA options.
>
> Co-authored-by: Zongkai LI 
> Signed-off-by: Zongkai LI 
> Signed-off-by: Numan Siddique 
> ---
>  include/ovn/actions.h |  14 +++-
>  ovn/controller/lflow.c|  11 +++-
>  ovn/controller/pinctrl.c  | 145 +
>  ovn/lib/actions.c | 161 ++
> +++-
>  ovn/lib/ovn-l7.h  |  55 
>  ovn/ovn-sb.xml|  77 ++
>  ovn/utilities/ovn-trace.c |  46 +
>  tests/ovn.at  |  31 +
>  tests/test-ovn.c  |  13 +++-
>  9 files changed, 533 insertions(+), 20 deletions(-)
>
> diff --git a/include/ovn/actions.h b/include/ovn/actions.h
> index de55d88c7..d15c13baa 100644
> --- a/include/ovn/actions.h
> +++ b/include/ovn/actions.h
> @@ -71,7 +71,8 @@ struct simap;
>  OVNACT(PUT_DHCPV4_OPTS, ovnact_put_opts)   \
>  OVNACT(PUT_DHCPV6_OPTS, ovnact_put_opts)   \
>  OVNACT(SET_QUEUE,   ovnact_set_queue)   \
> -OVNACT(DNS_LOOKUP,  ovnact_dns_lookup)
> +OVNACT(DNS_LOOKUP,  ovnact_dns_lookup)  \
> +OVNACT(PUT_ND_RA_OPTS,  ovnact_put_opts)
>
>  /* enum ovnact_type, with a member OVNACT_ for each action. */
>  enum OVS_PACKED_ENUM ovnact_type {
> @@ -400,6 +401,14 @@ enum action_opcode {
>   *
>   */
>  ACTION_OPCODE_DNS_LOOKUP,
> +
> +/* "result = put_nd_ra_opts(option, ...)".
> + * Arguments follow the action_header, in this format:
> + *   - A 32-bit or 64-bit OXM header designating the result field.
> + *   - A 32-bit integer specifying a bit offset within the result
> field.
> + *   - Any number of ICMPv6 options.
> + */
> +ACTION_OPCODE_PUT_ND_RA_OPTS,
>  };
>
>  /* Header. */
> @@ -420,6 +429,9 @@ struct ovnact_parse_params {
>  /* hmap of 'struct gen_opts_map'  to support 'put_dhcpv6_opts' action
> */
>  const struct hmap *dhcpv6_opts;
>
> +/* hmap of 'struct gen_opts_map' to support 'put_nd_ra_opts' action */
> +const struct hmap *nd_ra_opts;
> +
>  /* Each OVN flow exists in a logical table within a logical pipeline.
>   * These parameters express this context for a set of OVN actions
> being
>   * parsed:
> diff --git a/ovn/controller/lflow.c b/ovn/controller/lflow.c
> index c4fe5f9eb..fce132117 100644
> --- a/ovn/controller/lflow.c
> +++ b/ovn/controller/lflow.c
> @@ -63,6 +63,7 @@ static void consider_logical_flow(const struct
> lport_index *lports,
>const struct sbrec_chassis *chassis,
>struct hmap *dhcp_opts,
>struct hmap *dhcpv6_opts,
> +  struct hmap *nd_ra_opts,
>uint32_t *conj_id_ofs,
>const struct shash *addr_sets,
>struct hmap *flow_table);
> @@ -143,15 +144,19 @@ add_logical_flows(struct controller_ctx *ctx, const
> struct lport_index *lports,
>  dhcpv6_opt_row->type);
>  }
>
> +struct hmap nd_ra_opts = HMAP_INITIALIZER(&nd_ra_opts);
> +nd_ra_opts_init(&nd_ra_opts);
> +
>  SBREC_LOGICAL_FLOW_FOR_EACH (lflow, ctx->ovnsb_idl) {
>  consider_logical_flow(lports, mcgroups, lflow, local_datapaths,
>group_table, chassis,
> -  &dhcp_opts, &dhcpv6_opts, &conj_id_ofs,
> -  addr_sets, flow_table);
> +  &dhcp_opts, &dhcpv6_opts, &nd_ra_opts,
> +  &conj_id_ofs, addr_sets, flow_table);
>  }
>
>  dhcp_opts_destroy(&dhcp_opts);
>  dhcp_opts_destroy(&dhcpv6_opts);
> +nd_ra_opts_destroy(&nd_ra_opts);
>  }
>
>  static void
> @@ -163,6 +168,7 @@ conside

Re: [ovs-dev] [PATCH] ovn-architecture: Remove outdated comment.

2017-07-25 Thread Miguel Angel Ajo Pelayo
Acked-by: Miguel Angel Ajo 

On Mon, Jul 24, 2017 at 10:53 PM, Russell Bryant  wrote:

> This outdated comment said that support for hardware gateways that
> support the vtep schema would come later.  This was actually
> implemented a long time ago.
>
> Signed-off-by: Russell Bryant 
> ---
>  ovn/ovn-architecture.7.xml | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/ovn/ovn-architecture.7.xml b/ovn/ovn-architecture.7.xml
> index 5f73e2067..b13b41177 100644
> --- a/ovn/ovn-architecture.7.xml
> +++ b/ovn/ovn-architecture.7.xml
> @@ -53,8 +53,7 @@
>  packets between tunnels and a physical Ethernet port.  This allows
>  non-virtualized machines to participate in logical networks.  A
> gateway
>  may be a physical host, a virtual machine, or an ASIC-based
> hardware
> -switch that supports the vtep(5) schema.  (Support
> for the
> -latter will come later in OVN implementation.)
> +switch that supports the vtep(5) schema.
>
>
>
> --
> 2.13.3
>
> ___
> 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] [PATCH v4] Update relevant artifacts to add support for DPDK 17.05.1.

2017-07-25 Thread Michal Weglicki
Upgrading to DPDK 17.05.1 stable release adds new
significant features relevant to OVS, including,
but not limited to:
- tun/tap PMD,
- VFIO hotplug support,
- Generic flow API.

Following changes are applied:
- netdev-dpdk: Changes required by DPDK API modifications.
- doc: Because of DPDK API changes, backward compatibility
  with previous DPDK releases will be broken, thus all
  relevant documentation entries are updated.
- .travis: DPDK version change from 16.11.1 to 17.05.1.
- rhel/openvswitch-fedora.spec.in: DPDK version change
  from 16.11 to 17.05.1

v1->v2: Patch rebase.
v2->v3: Fixed wrong formating after v2 patch rebase.
v3->v4: Minor documentation changes.

Signed-off-by: Michal Weglicki 
Reviewed-by: Aaron Conole 
---
 .travis/linux-build.sh   |   2 +-
 Documentation/faq/releases.rst   |   1 +
 Documentation/howto/dpdk.rst |   6 +-
 Documentation/intro/install/dpdk.rst |  14 +--
 Documentation/topics/dpdk/vhost-user.rst |  12 +--
 NEWS |   1 +
 lib/netdev-dpdk.c| 144 +++
 rhel/openvswitch-fedora.spec.in  |   2 +-
 tests/dpdk/ring_client.c |   6 +-
 9 files changed, 114 insertions(+), 74 deletions(-)

diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index f66b534..efccdf1 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -80,7 +80,7 @@ fi
 
 if [ "$DPDK" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="16.11.2"
+DPDK_VER="17.05.1"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 707834b..2ecc24c 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -161,6 +161,7 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.5.x2.2
 2.6.x16.07.2
 2.7.x16.11.2
+2.8.x17.05.1
  ===
 
 Q: I get an error like this when I configure Open vSwitch:
diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst
index af01d3e..1756c8c 100644
--- a/Documentation/howto/dpdk.rst
+++ b/Documentation/howto/dpdk.rst
@@ -528,15 +528,15 @@ described in :ref:`dpdk-testpmd`. Once compiled, run the 
application::
 
 When you finish testing, bind the vNICs back to kernel::
 
-$ $DPDK_DIR/tools/dpdk-devbind.py --bind=virtio-pci :00:03.0
-$ $DPDK_DIR/tools/dpdk-devbind.py --bind=virtio-pci :00:04.0
+$ $DPDK_DIR/usertools/dpdk-devbind.py --bind=virtio-pci :00:03.0
+$ $DPDK_DIR/usertools/dpdk-devbind.py --bind=virtio-pci :00:04.0
 
 .. note::
 
   Valid PCI IDs must be passed in above example. The PCI IDs can be retrieved
   like so::
 
-  $ $DPDK_DIR/tools/dpdk-devbind.py --status
+  $ $DPDK_DIR/usertools/dpdk-devbind.py --status
 
 More information on the dpdkvhostuser ports can be found in
 :doc:`/topics/dpdk/vhost-user`.
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index a05aa1a..20baa63 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -40,7 +40,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 16.11
+- DPDK 17.05.1
 
 - A `DPDK supported NIC`_
 
@@ -69,9 +69,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget http://fast.dpdk.org/rel/dpdk-16.11.2.tar.xz
-   $ tar xf dpdk-16.11.2.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-16.11.2
+   $ wget http://fast.dpdk.org/rel/dpdk-17.05.1.tar.xz
+   $ tar xf dpdk-17.05.1.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-stable-17.05.1
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
@@ -187,8 +187,8 @@ to the VFIO driver::
 $ modprobe vfio-pci
 $ /usr/bin/chmod a+x /dev/vfio
 $ /usr/bin/chmod 0666 /dev/vfio/*
-$ $DPDK_DIR/tools/dpdk-devbind.py --bind=vfio-pci eth1
-$ $DPDK_DIR/tools/dpdk-devbind.py --status
+$ $DPDK_DIR/usertools/dpdk-devbind.py --bind=vfio-pci eth1
+$ $DPDK_DIR/usertools/dpdk-devbind.py --status
 
 Setup OVS
 ~
@@ -569,7 +569,7 @@ Limitations
   The latest list of validated firmware versions can be found in the `DPDK
   release notes`_.
 
-.. _DPDK release notes: http://dpdk.org/doc/guides/rel_notes/release_16_11.html
+.. _DPDK release notes: http://dpdk.org/doc/guides/rel_notes/release_17_05.html
 
 Reporting Bugs
 --
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index e76da5f..a3d5de3 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -292,9 +292,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to

Re: [ovs-dev] [PATCH 1/3] flow: Add packet_size option to flow_compose.

2017-07-25 Thread Ilya Maximets
On 24.07.2017 22:40, Andy Zhou wrote:
> On Mon, Jul 24, 2017 at 6:33 AM, Ilya Maximets  wrote:
>> On 22.07.2017 01:38, Andy Zhou wrote:
>>> On Wed, Jul 19, 2017 at 7:51 AM, Ilya Maximets  
>>> wrote:
 This allows to compose packets with different real lenghts from
 odp flows i.e. memory will be allocated for requested packet
 size and all required headers like ip->tot_len filled correctly.

 Will be used in netdev-dummy to properly handle '--len' option.

 Signed-off-by: Ilya Maximets 
>>>
>>> Thank you for working on this.  Although those functions are mainly
>>> for testing, it is still good that we improve them.
>>>
>>> I am wondering about a slightly different approach. Instead of adding
>>> 'packet_size' to the flow_compose() interface, would it make
>>> sense to come up with a new function whose task is to
>>> expand a packet to the final length, (similar to flow_compose_l4_csum())
>>>
>>> We would first create the necessary headers for all layers based on
>>> flow, without fill in the actual size related field or compute checksums.
>>>
>>> Then the fix size function will take over, fill in data, and
>>> update various headers.
>>>
>>> Then checksums can be computed and filled in.
>>>
>>> I think the logics will be easier to follow with this approach. What
>>> do you think?
>>
>>
>> I thought about this. I just tried to avoid double packet parsing,
>> but such approach could be interesting.
> 
> This approach looks fine to me.
>>
>> Below is the possible implementation.
>> If you think that it's better than the modification of flow_compose(),
>> I can send v2 with below implementation:
> 
> I don't think that eth_from_flow() adds much value. Would it
> be less clear if we just use flow_compose_xxx() APIs ?

String to flow parsing code complicates receive function.
I don't see a beautiful solution right now.
I'll send v2 with netdev-dummy changes as below.


> Please go ahead with V2. Looking forward to it.
> 
>>
>> --8<--->8--
>> diff --git a/lib/flow.c b/lib/flow.c
>> index e1597fa..ce99c06 100644
>> --- a/lib/flow.c
>> +++ b/lib/flow.c
>> @@ -2706,40 +2706,87 @@ flow_compose_l4_csum(struct dp_packet *p, const 
>> struct flow *flow,
>>  if (flow->nw_proto == IPPROTO_TCP) {
>>  struct tcp_header *tcp = dp_packet_l4(p);
>>
>> -/* Checksum has already been zeroed by put_zeros call in
>> - * flow_compose_l4(). */
>> +tcp->tcp_csum = 0;
>>  tcp->tcp_csum = csum_finish(csum_continue(pseudo_hdr_csum,
>>tcp, l4_len));
>>  } else if (flow->nw_proto == IPPROTO_UDP) {
>>  struct udp_header *udp = dp_packet_l4(p);
>>
>> -/* Checksum has already been zeroed by put_zeros call in
>> - * flow_compose_l4(). */
>> +udp->udp_csum = 0;
>>  udp->udp_csum = csum_finish(csum_continue(pseudo_hdr_csum,
>>udp, l4_len));
>>  } else if (flow->nw_proto == IPPROTO_ICMP) {
>>  struct icmp_header *icmp = dp_packet_l4(p);
>>
>> -/* Checksum has already been zeroed by put_zeros call in
>> - * flow_compose_l4(). */
>> +icmp->icmp_csum = 0;
>>  icmp->icmp_csum = csum(icmp, l4_len);
>>  } else if (flow->nw_proto == IPPROTO_IGMP) {
>>  struct igmp_header *igmp = dp_packet_l4(p);
>>
>> -/* Checksum has already been zeroed by put_zeros call in
>> - * flow_compose_l4(). */
>> +igmp->igmp_csum = 0;
>>  igmp->igmp_csum = csum(igmp, l4_len);
>>  } else if (flow->nw_proto == IPPROTO_ICMPV6) {
>>  struct icmp6_hdr *icmp = dp_packet_l4(p);
>>
>> -/* Checksum has already been zeroed by put_zeros call in
>> - * flow_compose_l4(). */
>> +icmp->icmp6_cksum = 0;
>>  icmp->icmp6_cksum = (OVS_FORCE uint16_t)
>>  csum_finish(csum_continue(pseudo_hdr_csum, icmp, l4_len));
>>  }
>>  }
>>  }
>>
>> +/* Tries to increase the size of packet composed by 'flow_compose' up to
>> + * 'size' bytes.  Fixes all the required packet headers like ip/udp lengths
>> + * and l3/l4 checksums. */
>> +void
>> +flow_compose_size(struct dp_packet *p, const struct flow *flow, size_t size)
>> +{
>> +size_t extra_size, l4_len;
>> +uint32_t pseudo_hdr_csum;
>> +
>> +if (size <= dp_packet_size(p)) {
>> +return;
>> +}
>> +
>> +extra_size = size - dp_packet_size(p);
>> +dp_packet_put_zeros(p, extra_size);
>> +
>> +l4_len = (char *) dp_packet_tail(p) - (char *) dp_packet_l4(p);
>> +
>> +if (flow->dl_type == htons(FLOW_DL_TYPE_NONE)) {
>> +struct eth_header *eth = dp_packet_eth(p);
>> +
>> +eth->eth_type = htons(dp_packet_size(p));
>> +return;
>> +}
>> +

[ovs-dev] [PATCH v2 0/3] Fix '--len' option for netdev-dummy/receive.

2017-07-25 Thread Ilya Maximets
See bug details is in patch #2.
First patch introduces 'flow_compose_size()' which is used
to fix bug in the second patch.
To trigger the issue unit test from patch #3 can be used.

Version 2:
* New function 'flow_compose_size' introduced instead
  of modification of 'flow_compose'.

Ilya Maximets (3):
  flow: Add flow_compose_size().
  netdev-dummy: Fix setting length in recieve command.
  dpif-netdev.at: Add netdev-dummy/receive test.

 lib/flow.c   | 65 
 lib/flow.h   |  1 +
 lib/netdev-dummy.c   | 25 
 tests/dpif-netdev.at | 21 +
 4 files changed, 93 insertions(+), 19 deletions(-)

-- 
2.7.4

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


[ovs-dev] [PATCH v2 1/3] flow: Add flow_compose_size().

2017-07-25 Thread Ilya Maximets
This allows to compose packets with different real lenghts from
odp flows i.e. memory will be allocated for requested packet
size and all required headers like ip->tot_len filled correctly.

Will be used in netdev-dummy to properly handle '--len' option.

Suggested-by: Andy Zhou 
Signed-off-by: Ilya Maximets 
---
 lib/flow.c | 65 --
 lib/flow.h |  1 +
 2 files changed, 56 insertions(+), 10 deletions(-)

diff --git a/lib/flow.c b/lib/flow.c
index e1597fa..8da9f32 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -2706,40 +2706,85 @@ flow_compose_l4_csum(struct dp_packet *p, const struct 
flow *flow,
 if (flow->nw_proto == IPPROTO_TCP) {
 struct tcp_header *tcp = dp_packet_l4(p);
 
-/* Checksum has already been zeroed by put_zeros call in
- * flow_compose_l4(). */
+tcp->tcp_csum = 0;
 tcp->tcp_csum = csum_finish(csum_continue(pseudo_hdr_csum,
   tcp, l4_len));
 } else if (flow->nw_proto == IPPROTO_UDP) {
 struct udp_header *udp = dp_packet_l4(p);
 
-/* Checksum has already been zeroed by put_zeros call in
- * flow_compose_l4(). */
+udp->udp_csum = 0;
 udp->udp_csum = csum_finish(csum_continue(pseudo_hdr_csum,
   udp, l4_len));
 } else if (flow->nw_proto == IPPROTO_ICMP) {
 struct icmp_header *icmp = dp_packet_l4(p);
 
-/* Checksum has already been zeroed by put_zeros call in
- * flow_compose_l4(). */
+icmp->icmp_csum = 0;
 icmp->icmp_csum = csum(icmp, l4_len);
 } else if (flow->nw_proto == IPPROTO_IGMP) {
 struct igmp_header *igmp = dp_packet_l4(p);
 
-/* Checksum has already been zeroed by put_zeros call in
- * flow_compose_l4(). */
+igmp->igmp_csum = 0;
 igmp->igmp_csum = csum(igmp, l4_len);
 } else if (flow->nw_proto == IPPROTO_ICMPV6) {
 struct icmp6_hdr *icmp = dp_packet_l4(p);
 
-/* Checksum has already been zeroed by put_zeros call in
- * flow_compose_l4(). */
+icmp->icmp6_cksum = 0;
 icmp->icmp6_cksum = (OVS_FORCE uint16_t)
 csum_finish(csum_continue(pseudo_hdr_csum, icmp, l4_len));
 }
 }
 }
 
+/* Tries to increase the size of packet composed by 'flow_compose' up to
+ * 'size' bytes.  Fixes all the required packet headers like ip/udp lengths
+ * and l3/l4 checksums. */
+void
+flow_compose_size(struct dp_packet *p, const struct flow *flow, size_t size)
+{
+size_t extra_size;
+
+if (size <= dp_packet_size(p)) {
+return;
+}
+
+extra_size = size - dp_packet_size(p);
+dp_packet_put_zeros(p, extra_size);
+
+if (flow->dl_type == htons(FLOW_DL_TYPE_NONE)) {
+struct eth_header *eth = dp_packet_eth(p);
+
+eth->eth_type = htons(dp_packet_size(p));
+
+} else if (dl_type_is_ip_any(flow->dl_type)) {
+uint32_t pseudo_hdr_csum;
+size_t l4_len = (char *) dp_packet_tail(p) - (char *) dp_packet_l4(p);
+
+if (flow->dl_type == htons(ETH_TYPE_IP)) {
+struct ip_header *ip = dp_packet_l3(p);
+
+ip->ip_tot_len = htons(p->l4_ofs - p->l3_ofs + l4_len);
+ip->ip_csum = 0;
+ip->ip_csum = csum(ip, sizeof *ip);
+
+pseudo_hdr_csum = packet_csum_pseudoheader(ip);
+} else { /* ETH_TYPE_IPV6 */
+struct ovs_16aligned_ip6_hdr *nh = dp_packet_l3(p);
+
+nh->ip6_plen = htons(l4_len);
+pseudo_hdr_csum = packet_csum_pseudoheader6(nh);
+}
+
+if ((!(flow->nw_frag & FLOW_NW_FRAG_ANY)
+ || !(flow->nw_frag & FLOW_NW_FRAG_LATER))
+&& flow->nw_proto == IPPROTO_UDP) {
+struct udp_header *udp = dp_packet_l4(p);
+
+udp->udp_len = htons(l4_len + extra_size);
+}
+flow_compose_l4_csum(p, flow, pseudo_hdr_csum);
+}
+}
+
 /* Puts into 'p' a packet that flow_extract() would parse as having the given
  * 'flow'.
  *
diff --git a/lib/flow.h b/lib/flow.h
index 9297842..1bbbe41 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -125,6 +125,7 @@ void flow_set_mpls_bos(struct flow *, int idx, uint8_t 
stack);
 void flow_set_mpls_lse(struct flow *, int idx, ovs_be32 lse);
 
 void flow_compose(struct dp_packet *, const struct flow *);
+void flow_compose_size(struct dp_packet *, const struct flow *, size_t size);
 
 bool parse_ipv6_ext_hdrs(const void **datap, size_t *sizep, uint8_t *nw_proto,
  uint8_t *nw_frag);
-- 
2.7.4

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


[ovs-dev] [PATCH v2 2/3] netdev-dummy: Fix setting length in recieve command.

2017-07-25 Thread Ilya Maximets
Currently, if '--len' option passed to 'netdev-dummy/receive' command,
only 'size' field of dp_packet will changes.

This is incorrect behaviour, because memory for that size is not
allocated and also packet headers not fixed to reflect the new size.
This leads to flow_extract() failure, because it checks the
'ip->tot_len' and stops further parsing if it doesn't match the
dp_packet_size(). As a result packets created while processing of the
'receive' command can't be parsed to the same flow.
Additionally this may lead to wrong memory accesses in case someone
will try to read or modify packets data.

Fix that by creating right packets using recently introduced
'flow_compose_size()'.

CC: Andy Zhou 
Fixes: d8ada2368cbe ("netdev-dummy: Add --len option for netdev-dummy/receive 
command")
Signed-off-by: Ilya Maximets 
---
 lib/netdev-dummy.c | 25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 51d29d5..83e30b3 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -1449,7 +1449,7 @@ eth_from_packet(const char *s)
 }
 
 static struct dp_packet *
-eth_from_flow(const char *s)
+eth_from_flow(const char *s, size_t packet_size)
 {
 enum odp_key_fitness fitness;
 struct dp_packet *packet;
@@ -1479,6 +1479,7 @@ eth_from_flow(const char *s)
 
 packet = dp_packet_new(0);
 flow_compose(packet, &flow);
+flow_compose_size(packet, &flow, packet_size);
 
 ofpbuf_uninit(&odp_key);
 return packet;
@@ -1556,20 +1557,26 @@ netdev_dummy_receive(struct unixctl_conn *conn,
 packet = eth_from_packet(argv[i]);
 
 if (!packet) {
+int packet_size = 0;
+const char *flow_str = argv[i];
+
+/* Parse optional --len argument immediately follows a 'flow'.  */
+if (argc >= i + 2 && !strcmp(argv[i + 1], "--len")) {
+packet_size = strtol(argv[i + 2], NULL, 10);
+
+if (packet_size < ETH_TOTAL_MIN) {
+unixctl_command_reply_error(conn, "too small packet len");
+goto exit;
+}
+i+=2;
+}
 /* Try parse 'argv[i]' as odp flow. */
-packet = eth_from_flow(argv[i]);
+packet = eth_from_flow(flow_str, packet_size);
 
 if (!packet) {
 unixctl_command_reply_error(conn, "bad packet or flow syntax");
 goto exit;
 }
-
-/* Parse optional --len argument immediately follows a 'flow'.  */
-if (argc >= i + 2 && !strcmp(argv[i + 1], "--len")) {
-int packet_size = strtol(argv[i + 2], NULL, 10);
-dp_packet_set_size(packet, packet_size);
-i+=2;
-}
 }
 
 netdev_dummy_queue_packet(dummy_dev, packet, rx_qid);
-- 
2.7.4

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


[ovs-dev] [PATCH v2 3/3] dpif-netdev.at: Add netdev-dummy/receive test.

2017-07-25 Thread Ilya Maximets
Regression test for 'netdev-dummy/receive' appctl command.

Signed-off-by: Ilya Maximets 
---
 tests/dpif-netdev.at | 21 +
 1 file changed, 21 insertions(+)

diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at
index a526b85..c6f6a66 100644
--- a/tests/dpif-netdev.at
+++ b/tests/dpif-netdev.at
@@ -47,6 +47,27 @@ strip_metadata () {
 ]
 m4_divert_pop([PREPARE_TESTS])
 
+AT_SETUP([dpif-netdev - netdev-dummy/receive])
+# Create br0 with interfaces p0
+OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy 
ofport_request=1 -- ])
+AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
+
+AT_CHECK([ovs-ofctl add-flow br0 action=normal])
+ovs-appctl time/stop
+ovs-appctl time/warp 5000
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 
'in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:02:00),eth_type(0x0800),ipv4(src=10.0.0.1,dst=10.0.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack)'])
+   AT_CHECK([grep -A 1 'miss upcall' ovs-vswitchd.log | tail -n 1], [0], [dnl
+skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:01,dst=50:54:00:00:02:00),eth_type(0x0800),ipv4(src=10.0.0.1,dst=10.0.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack)
+])
+
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 
'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:06:00),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.6,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack)'
 --len 1024])
+   AT_CHECK([grep -A 1 'miss upcall' ovs-vswitchd.log | tail -n 1], [0], [dnl
+skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:05,dst=50:54:00:00:06:00),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.6,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack)
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+
 m4_define([DPIF_NETDEV_DUMMY_IFACE],
   [AT_SETUP([dpif-netdev - $1 interface])
# Create br0 with interfaces p1 and p7
-- 
2.7.4

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


[ovs-dev] OVS-DPDK public meeting

2017-07-25 Thread Kevin Traynor
Hi All,

The OVS-DPDK public meetings have moved to Wednesday's at the same time.
Everyone is welcome, it's a chance to share status/plans etc.

It's scheduled for every 2 weeks starting 26th July. Meeting time is
currently @ 4pm UTC.

You can connect through Bluejeans or through dial in:

https://bluejeans.com/139318596

US: +1.408.740.7256
UK: +44.203.608.5256
Germany: +49.32.221.091256
Ireland: +353.1.697.1256
Other numbers at https://www.bluejeans.com/numbers
Meeting ID: 139318596

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


Re: [ovs-dev] [PATCH] ovn-architecture: Remove outdated comment.

2017-07-25 Thread Russell Bryant
Thanks, applied to master.

On Tue, Jul 25, 2017 at 8:45 AM, Miguel Angel Ajo Pelayo
 wrote:
> Acked-by: Miguel Angel Ajo 
>
> On Mon, Jul 24, 2017 at 10:53 PM, Russell Bryant  wrote:
>>
>> This outdated comment said that support for hardware gateways that
>> support the vtep schema would come later.  This was actually
>> implemented a long time ago.
>>
>> Signed-off-by: Russell Bryant 
>> ---
>>  ovn/ovn-architecture.7.xml | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/ovn/ovn-architecture.7.xml b/ovn/ovn-architecture.7.xml
>> index 5f73e2067..b13b41177 100644
>> --- a/ovn/ovn-architecture.7.xml
>> +++ b/ovn/ovn-architecture.7.xml
>> @@ -53,8 +53,7 @@
>>  packets between tunnels and a physical Ethernet port.  This
>> allows
>>  non-virtualized machines to participate in logical networks.  A
>> gateway
>>  may be a physical host, a virtual machine, or an ASIC-based
>> hardware
>> -switch that supports the vtep(5) schema.  (Support
>> for the
>> -latter will come later in OVN implementation.)
>> +switch that supports the vtep(5) schema.
>>
>>
>>
>> --
>> 2.13.3
>>
>> ___
>> dev mailing list
>> d...@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>



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


Re: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.

2017-07-25 Thread Fischetti, Antonio
Hi Darrell, I posted a v5 at http://patchwork.ozlabs.org/patch/792723/
where I added all your suggestions.

Thanks,
-Antonio

> -Original Message-
> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> boun...@openvswitch.org] On Behalf Of Fischetti, Antonio
> Sent: Monday, July 24, 2017 10:45 AM
> To: Darrell Ball ; d...@openvswitch.org
> Subject: Re: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.
> 
> Thanks Darrell, I will apply your suggetions.
> 
> -Antonio
> 
> > -Original Message-
> > From: Darrell Ball [mailto:db...@vmware.com]
> > Sent: Sunday, July 23, 2017 6:28 PM
> > To: Fischetti, Antonio ;
> d...@openvswitch.org
> > Subject: Re: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.
> >
> > Minor comment:
> >
> > When applying the patch, there is a complaint about new whitespace below
> 
> [Antonio] will remove it.
> 
> 
> >
> > +the number of connections in a bucket is greater than \fIThreshold\fR.
> > +
> >
> > Two comments inline
> >
> >
> > -Original Message-
> > From:  on behalf of
> > "antonio.fische...@intel.com" 
> > Date: Saturday, July 22, 2017 at 7:38 AM
> > To: "d...@openvswitch.org" 
> > Subject: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.
> >
> > With the command:
> >  ovs-appctl dpctl/ct-bkts
> > shows the number of connections per bucket.
> >
> > By using a threshold:
> >  ovs-appctl dpctl/ct-bkts gt=N
> > for each bucket shows the number of connections when they
> > are greater than N.
> >
> > Signed-off-by: Antonio Fischetti 
> > Signed-off-by: Bhanuprakash Bodireddy
> > 
> > Co-authored-by: Bhanuprakash Bodireddy
> > 
> > ---
> >  lib/conntrack.c|   9 ++--
> >  lib/conntrack.h|   2 +-
> >  lib/ct-dpif.c  |   4 +-
> >  lib/ct-dpif.h  |   3 +-
> >  lib/dpctl.c| 108
> > -
> >  lib/dpctl.man  |   8 +++
> >  lib/dpif-netdev.c  |   4 +-
> >  lib/dpif-netlink.c |   4 +-
> >  lib/dpif-provider.h|   2 +-
> >  lib/netlink-conntrack.c|   6 ++-
> >  lib/netlink-conntrack.h|   3 +-
> >  tests/test-netlink-conntrack.c |   3 +-
> >  utilities/ovs-dpctl.c  |   1 +
> >  13 files changed, 140 insertions(+), 17 deletions(-)
> >
> > diff --git a/lib/conntrack.c b/lib/conntrack.c
> > index de46a6b..e290b20 100644
> > --- a/lib/conntrack.c
> > +++ b/lib/conntrack.c
> > @@ -1931,7 +1931,7 @@ conn_key_to_tuple(const struct conn_key *key,
> > struct ct_dpif_tuple *tuple)
> >
> >  static void
> >  conn_to_ct_dpif_entry(const struct conn *conn, struct ct_dpif_entry
> > *entry,
> > -  long long now)
> > +  long long now, int bkt)
> >  {
> >  struct ct_l4_proto *class;
> >  long long expiration;
> > @@ -1954,11 +1954,12 @@ conn_to_ct_dpif_entry(const struct conn
> *conn,
> > struct ct_dpif_entry *entry,
> >  if (class->conn_get_protoinfo) {
> >  class->conn_get_protoinfo(conn, &entry->protoinfo);
> >  }
> > +entry->bkt = bkt;
> >  }
> >
> >  int
> >  conntrack_dump_start(struct conntrack *ct, struct conntrack_dump
> > *dump,
> > - const uint16_t *pzone)
> > + const uint16_t *pzone, int *ptot_bkts)
> >  {
> >  memset(dump, 0, sizeof(*dump));
> >  if (pzone) {
> > @@ -1967,6 +1968,8 @@ conntrack_dump_start(struct conntrack *ct,
> > struct conntrack_dump *dump,
> >  }
> >  dump->ct = ct;
> >
> > +*ptot_bkts = CONNTRACK_BUCKETS;
> > +
> >  return 0;
> >  }
> >
> > @@ -1991,7 +1994,7 @@ conntrack_dump_next(struct conntrack_dump
> *dump,
> > struct ct_dpif_entry *entry)
> >  INIT_CONTAINER(conn, node, node);
> >  if ((!dump->filter_zone || conn->key.zone == dump-
> >zone)
> > &&
> >   (conn->conn_type != CT_CONN_TYPE_UN_NAT)) {
> > -conn_to_ct_dpif_entry(conn, entry, now);
> > +conn_to_ct_dpif_entry(conn, entry, now, dump-
> > >bucket);
> >  break;
> >  }
> >  /* Else continue, until we find an entry in the
> > appropriate zone
> > diff --git a/lib/conntrack.h b/lib/conntrack.h
> > index defde4c..3f48444 100644
> > --- a/lib/conntrack.h
> > +++ b/lib/conntrack.h
> > @@ -108,7 +108,7 @@ struct conntrack_dump {
> >  struct ct_dpif_entry;
> >
> >  int conntrack_dump_start(struct conntrack *, struct conntrack_dump
> *,
> > - const uint16_t *pzone);
> > + const uint16_t *pzone, int *);
> >  int conntrack_dump_next(struct conntrack_dump *, struct
> ct_dpif_entry
> > *);
> >  int conn

Re: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.

2017-07-25 Thread Darrell Ball
Hi Antonio

I had done a quick check of the two point changes, but, I did not retest, since 
I tested twice before.
Thanks for the enhancement.
This will go into 2.8.

Thanks Darrell

-Original Message-
From: "Fischetti, Antonio" 
Date: Tuesday, July 25, 2017 at 6:57 AM
To: "Fischetti, Antonio" , Darrell Ball 
, "d...@openvswitch.org" 
Subject: RE: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.

Hi Darrell, I posted a v5 at 
https://urldefense.proofpoint.com/v2/url?u=http-3A__patchwork.ozlabs.org_patch_792723_&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=Mxh35xY_PS5nbtJNTKQnPqKl_7BotQ7kLayJzzAmuck&s=rc3sgx0RTpbMglULZqL1zVX831XgJKNmQktLaFN6kIQ&e=
 

where I added all your suggestions.



Thanks,

-Antonio



> -Original Message-

> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-

> boun...@openvswitch.org] On Behalf Of Fischetti, Antonio

> Sent: Monday, July 24, 2017 10:45 AM

> To: Darrell Ball ; d...@openvswitch.org

> Subject: Re: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.

> 

> Thanks Darrell, I will apply your suggetions.

> 

> -Antonio

> 

> > -Original Message-

> > From: Darrell Ball [mailto:db...@vmware.com]

> > Sent: Sunday, July 23, 2017 6:28 PM

> > To: Fischetti, Antonio ;

> d...@openvswitch.org

> > Subject: Re: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.

> >

> > Minor comment:

> >

> > When applying the patch, there is a complaint about new whitespace below

> 

> [Antonio] will remove it.

> 

> 

> >

> > +the number of connections in a bucket is greater than \fIThreshold\fR.

> > +

> >

> > Two comments inline

> >

> >

> > -Original Message-

> > From:  on behalf of

> > "antonio.fische...@intel.com" 

> > Date: Saturday, July 22, 2017 at 7:38 AM

> > To: "d...@openvswitch.org" 

> > Subject: [ovs-dev] [PATCH v4] dpctl: Add new 'ct-bkts' command.

> >

> > With the command:

> >  ovs-appctl dpctl/ct-bkts

> > shows the number of connections per bucket.

> >

> > By using a threshold:

> >  ovs-appctl dpctl/ct-bkts gt=N

> > for each bucket shows the number of connections when they

> > are greater than N.

> >

> > Signed-off-by: Antonio Fischetti 

> > Signed-off-by: Bhanuprakash Bodireddy

> > 

> > Co-authored-by: Bhanuprakash Bodireddy

> > 

> > ---

> >  lib/conntrack.c|   9 ++--

> >  lib/conntrack.h|   2 +-

> >  lib/ct-dpif.c  |   4 +-

> >  lib/ct-dpif.h  |   3 +-

> >  lib/dpctl.c| 108

> > -

> >  lib/dpctl.man  |   8 +++

> >  lib/dpif-netdev.c  |   4 +-

> >  lib/dpif-netlink.c |   4 +-

> >  lib/dpif-provider.h|   2 +-

> >  lib/netlink-conntrack.c|   6 ++-

> >  lib/netlink-conntrack.h|   3 +-

> >  tests/test-netlink-conntrack.c |   3 +-

> >  utilities/ovs-dpctl.c  |   1 +

> >  13 files changed, 140 insertions(+), 17 deletions(-)

> >

> > diff --git a/lib/conntrack.c b/lib/conntrack.c

> > index de46a6b..e290b20 100644

> > --- a/lib/conntrack.c

> > +++ b/lib/conntrack.c

> > @@ -1931,7 +1931,7 @@ conn_key_to_tuple(const struct conn_key *key,

> > struct ct_dpif_tuple *tuple)

> >

> >  static void

> >  conn_to_ct_dpif_entry(const struct conn *conn, struct ct_dpif_entry

> > *entry,

> > -  long long now)

> > +  long long now, int bkt)

> >  {

> >  struct ct_l4_proto *class;

> >  long long expiration;

> > @@ -1954,11 +1954,12 @@ conn_to_ct_dpif_entry(const struct conn

> *conn,

> > struct ct_dpif_entry *entry,

> >  if (class->conn_get_protoinfo) {

> >  class->conn_get_protoinfo(conn, &entry->protoinfo);

> >  }

> > +entry->bkt = bkt;

> >  }

> >

> >  int

> >  conntrack_dump_start(struct conntrack *ct, struct conntrack_dump

> > *dump,

> > - const uint16_t *pzone)

> > +

[ovs-dev] [PATCH] datapath: fix potential out of bound access in parse_ct

2017-07-25 Thread Greg Rose
Upstream commit:
commit 69ec932e364b1ba9c3a2085fe96b76c8a3f71e7c
Author: Liping Zhang 
Date:   Sun Jul 23 17:52:23 2017 +0800

openvswitch: fix potential out of bound access in parse_ct

Before the 'type' is validated, we shouldn't use it to fetch the
ovs_ct_attr_lens's minlen and maxlen, else, out of bound access
may happen.

Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
Signed-off-by: Liping Zhang 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Pick up an upstream bug fix.

Signed-off-by: Greg Rose 
---
 datapath/conntrack.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index bba9bfe..b645ab1 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -1356,8 +1356,8 @@ static int parse_ct(const struct nlattr *attr, struct 
ovs_conntrack_info *info,
 
nla_for_each_nested(a, attr, rem) {
int type = nla_type(a);
-   int maxlen = ovs_ct_attr_lens[type].maxlen;
-   int minlen = ovs_ct_attr_lens[type].minlen;
+   int maxlen;
+   int minlen;
 
if (type > OVS_CT_ATTR_MAX) {
OVS_NLERR(log,
@@ -1365,6 +1365,9 @@ static int parse_ct(const struct nlattr *attr, struct 
ovs_conntrack_info *info,
  type, OVS_CT_ATTR_MAX);
return -EINVAL;
}
+
+   maxlen = ovs_ct_attr_lens[type].maxlen;
+   minlen = ovs_ct_attr_lens[type].minlen;
if (nla_len(a) < minlen || nla_len(a) > maxlen) {
OVS_NLERR(log,
  "Conntrack attr type has unexpected length 
(type=%d, length=%d, expected=%d)",
-- 
1.8.3.1

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


[ovs-dev] [PATCH V2] datapath: fix potential out of bound access in parse_ct

2017-07-25 Thread Greg Rose
Upstream commit:
commit 69ec932e364b1ba9c3a2085fe96b76c8a3f71e7c
Author: Liping Zhang 
Date:   Sun Jul 23 17:52:23 2017 +0800

openvswitch: fix potential out of bound access in parse_ct

Before the 'type' is validated, we shouldn't use it to fetch the
ovs_ct_attr_lens's minlen and maxlen, else, out of bound access
may happen.

Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
Signed-off-by: Liping Zhang 
Acked-by: Pravin B Shelar 
Signed-off-by: David S. Miller 

Pick up an upstream bug fix.

Fixes: a94ebc39996b ("datapath: Add conntrack action")
Signed-off-by: Greg Rose 
---
V2 - Add appropriate "Fixes" tag for OOT repository
---
 datapath/conntrack.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index bba9bfe..b645ab1 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -1356,8 +1356,8 @@ static int parse_ct(const struct nlattr *attr, struct 
ovs_conntrack_info *info,
 
nla_for_each_nested(a, attr, rem) {
int type = nla_type(a);
-   int maxlen = ovs_ct_attr_lens[type].maxlen;
-   int minlen = ovs_ct_attr_lens[type].minlen;
+   int maxlen;
+   int minlen;
 
if (type > OVS_CT_ATTR_MAX) {
OVS_NLERR(log,
@@ -1365,6 +1365,9 @@ static int parse_ct(const struct nlattr *attr, struct 
ovs_conntrack_info *info,
  type, OVS_CT_ATTR_MAX);
return -EINVAL;
}
+
+   maxlen = ovs_ct_attr_lens[type].maxlen;
+   minlen = ovs_ct_attr_lens[type].minlen;
if (nla_len(a) < minlen || nla_len(a) > maxlen) {
OVS_NLERR(log,
  "Conntrack attr type has unexpected length 
(type=%d, length=%d, expected=%d)",
-- 
1.8.3.1

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


Re: [ovs-dev] [PATCH v4] Update relevant artifacts to add support for DPDK 17.05.1.

2017-07-25 Thread Kevin Traynor
On 07/25/2017 01:34 PM, Michal Weglicki wrote:
> Upgrading to DPDK 17.05.1 stable release adds new
> significant features relevant to OVS, including,
> but not limited to:
> - tun/tap PMD,
> - VFIO hotplug support,
> - Generic flow API.
> 
> Following changes are applied:
> - netdev-dpdk: Changes required by DPDK API modifications.
> - doc: Because of DPDK API changes, backward compatibility
>   with previous DPDK releases will be broken, thus all
>   relevant documentation entries are updated.
> - .travis: DPDK version change from 16.11.1 to 17.05.1.
> - rhel/openvswitch-fedora.spec.in: DPDK version change
>   from 16.11 to 17.05.1
> 
> v1->v2: Patch rebase.
> v2->v3: Fixed wrong formating after v2 patch rebase.
> v3->v4: Minor documentation changes.
> 
> Signed-off-by: Michal Weglicki 
> Reviewed-by: Aaron Conole 
> ---

Thanks Michal. I tried a few things out and working ok for me.

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


Re: [ovs-dev] ovs delete flow slowly when there are many the flows

2017-07-25 Thread Joe Stringer
On 24 July 2017 at 18:42, 刘文学  wrote:
> Hi,  Joe Stringer:
>   the flows are deleted because of they are expired, the one core of cpu
> is 100% because of there are many flows need to be deleted.

Hmm. I would first suggest upgrading to the latest OVS release, some
of the changes may affect this behaviour. If you still have such a
problem, then you might consider looking into how to improve the
situation.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 1/2] ovs-bugtool: Collect OVS logs with "--ovs" option.

2017-07-25 Thread Gurucharan Shetty
ovs-bugtool collects a lot of data. This can be time
consuming and can end up collecting a lot of redundant data.
A option "--ovs" was added a while ago to only collect
OVS relevent data. We missed adding the OVS logs to this
filter.

Signed-off-by: Gurucharan Shetty 
---
 utilities/bugtool/ovs-bugtool.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in
index 5eb3440..b47d9a4 100755
--- a/utilities/bugtool/ovs-bugtool.in
+++ b/utilities/bugtool/ovs-bugtool.in
@@ -659,7 +659,7 @@ exclude those logs from the archive.
 if only_ovs_info:
 filters.add('ovs')
 ovs_info_caps = [CAP_NETWORK_STATUS, CAP_SYSTEM_LOGS,
- CAP_NETWORK_CONFIG]
+ CAP_OPENVSWITCH_LOGS, CAP_NETWORK_CONFIG]
 ovs_info_list = ['process-tree']
 # We cannot use iteritems, since we modify 'data' as we pass through
 for (k, v) in data.items():
-- 
1.9.1

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


[ovs-dev] [PATCH 2/2] ovs-bugtool: Run the 'dmesg' command without condition.

2017-07-25 Thread Gurucharan Shetty
Currently we look for files with the name of "dmesg"
in "/var/log". If it exists, we don't run the command
"dmesg". This is unreliable as the file does not always
contain the latest dmesg information.

Since OVS kernel module emits information to dmesg,
we need this information to debug bugs. So always
run the "dmesg" command and collect its output.

Signed-off-by: Gurucharan Shetty 
---
 utilities/bugtool/ovs-bugtool.in | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in
index b47d9a4..e886844 100755
--- a/utilities/bugtool/ovs-bugtool.in
+++ b/utilities/bugtool/ovs-bugtool.in
@@ -637,9 +637,7 @@ exclude those logs from the archive.
 prefix_output(CAP_OPENVSWITCH_LOGS, log,
   last_mod_time=log_last_mod_time)
 
-if not os.path.exists('/var/log/dmesg') and \
-   not os.path.exists('/var/log/boot'):
-cmd_output(CAP_SYSTEM_LOGS, [DMESG])
+cmd_output(CAP_SYSTEM_LOGS, [DMESG])
 
 cmd_output(CAP_SYSTEM_SERVICES, [CHKCONFIG, '--list'])
 
-- 
1.9.1

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


[ovs-dev] [PATCH] bond: Adjust bond hash masks

2017-07-25 Thread Andy Zhou
Commit 42781e77035d (bond: Unify hash functions in hash action and entry
lookup.) changed the BM_TCP's hash function, but did not update
hash mask fields accordingly.  Found by inspection.

CC: Ilya Maximets 
Signed-off-by: Andy Zhou 
---
 ofproto/bond.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index e09136efbd98..7d8d6560c690 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -1798,11 +1798,12 @@ choose_output_slave(const struct bond *bond, const 
struct flow *flow,
 return NULL;
 }
 if (wc) {
-flow_mask_hash_fields(flow, wc, NX_HASH_FIELDS_SYMMETRIC_L4);
+flow_mask_hash_fields(flow, wc,
+  NX_HASH_FIELDS_SYMMETRIC_L3L4_UDP);
 }
 /* Fall Through. */
 case BM_SLB:
-if (wc) {
+if (wc && balance == BM_SLB) {
 flow_mask_hash_fields(flow, wc, NX_HASH_FIELDS_ETH_SRC);
 }
 e = lookup_bond_entry(bond, flow, vlan);
-- 
1.9.1

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


Re: [ovs-dev] [PATCH v2 1/3] vswitch.xml: Fix L2 balancing mentioning for balance-tcp bond.

2017-07-25 Thread Andy Zhou
Thanks. I have pushed the series to master.

While applying the patches. I noticed a minor issue and sent a follow
up patch at:

https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/336231.html

Will consider back porting after this patch is reviewed.

On Tue, Jul 25, 2017 at 3:46 AM, Ilya Maximets  wrote:
> L2 fields are not used in userspace hash action since
> commit 4f150744921f ("dpif-netdev: Use miniflow as a flow key.").
> In kernel datapath RSS (which is not include L2 by default for
> most of the NICs) was used from the beginning. This means that
> if recirculation is in use, L2 fields are not used for flow
> balancing.
>
> Fix the documentation accordingly.
>
> Signed-off-by: Ilya Maximets 
> ---
>
> I think, this should be applied to some stable branches too.
>
>  vswitchd/vswitch.xml | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
> index 883ecd8..074535b 100644
> --- a/vswitchd/vswitch.xml
> +++ b/vswitchd/vswitch.xml
> @@ -1569,9 +1569,8 @@
>
>  balance-tcp
>  
> -  Balances flows among slaves based on L2, L3, and L4 protocol
> -  information such as destination MAC address, IP address, and TCP
> -  port.
> +  Balances flows among slaves based on L3 and L4 protocol information
> +  such as IP addresses and TCP/UDP ports.
>  
>
>
> --
> 2.7.4
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] AUTHORS.rst: Add Mark Michelson.

2017-07-25 Thread Russell Bryant
Mark authored commit 747c31c9.

Signed-off-by: Russell Bryant 
---
 AUTHORS.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/AUTHORS.rst b/AUTHORS.rst
index 177cef8fd..21a68c140 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -208,6 +208,7 @@ Mark D. Graymark.d.g...@intel.com
 Mark Hamilton   mhamil...@nicira.com
 Mark Kavanagh   mark.b.kavan...@intel.com
 Mark Maglanammagl...@gmail.com
+Mark Michelson  mmich...@redhat.com
 Markos Chandras mchand...@suse.de
 Martin Casado   cas...@nicira.com
 Martino Fornasa m...@fornasa.it
-- 
2.13.3

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


Re: [ovs-dev] [PATCH] AUTHORS.rst: Add Mark Michelson.

2017-07-25 Thread Lance Richardson
> From: "Russell Bryant" 
> To: d...@openvswitch.org
> Sent: Tuesday, 25 July, 2017 3:40:33 PM
> Subject: [ovs-dev] [PATCH] AUTHORS.rst: Add Mark Michelson.
> 
> Mark authored commit 747c31c9.
> 
> Signed-off-by: Russell Bryant 
> ---
>  AUTHORS.rst | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/AUTHORS.rst b/AUTHORS.rst
> index 177cef8fd..21a68c140 100644
> --- a/AUTHORS.rst
> +++ b/AUTHORS.rst
> @@ -208,6 +208,7 @@ Mark D. Graymark.d.g...@intel.com
>  Mark Hamilton   mhamil...@nicira.com
>  Mark Kavanagh   mark.b.kavan...@intel.com
>  Mark Maglanammagl...@gmail.com
> +Mark Michelson  mmich...@redhat.com
>  Markos Chandras mchand...@suse.de
>  Martin Casado   cas...@nicira.com
>  Martino Fornasa m...@fornasa.it
> --
> 2.13.3
> 

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


Re: [ovs-dev] [PATCH] stream-ssl: Fix memory leak in error scenario

2017-07-25 Thread Russell Bryant
On Fri, Jul 21, 2017 at 4:46 PM, Mark Michelson  wrote:
> ssl_new_stream() takes ownership of the passed-in 'name' parameter.
> In error scenarios, the name is leaked. I was able to trigger this
> leak by attempting to connect to an ovsdb over SSL and specifying
> non-existent certificate, private key, and CA cert files.
>
> This patch fixes the problem by freeing 'name' in the error label.
>
> Signed-off-by: Mark Michelson 

Thanks!  I applied this to master.

I also applied a patch adding your name to the AUTHORS.rst file.

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


Re: [ovs-dev] [PATCH] AUTHORS.rst: Add Mark Michelson.

2017-07-25 Thread Russell Bryant
On Tue, Jul 25, 2017 at 3:40 PM, Russell Bryant  wrote:
> Mark authored commit 747c31c9.
>
> Signed-off-by: Russell Bryant 

I went ahead and applied this when applying another patch from Mark.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] flow: Refactor flow_compose() API.

2017-07-25 Thread Andy Zhou
Currently, flow_compose_size() is only supposed to be called after
flow_compose(). I find this API to be unintuitive.

Change flow_compose() API to take the 'size' argument, and
returns 'true' if the packet can be created, 'false' otherwise.

This change also improves error detection and reporting when
'size' is unreasonably small.

Signed-off-by: Andy Zhou 
---
 lib/flow.c   | 53 ++--
 lib/flow.h   |  3 +--
 lib/netdev-dummy.c   |  7 --
 ofproto/ofproto-dpif-trace.c |  2 +-
 ofproto/ofproto-dpif.c   |  2 +-
 ovn/controller/ofctrl.c  |  2 +-
 tests/test-ovn.c |  2 +-
 7 files changed, 51 insertions(+), 20 deletions(-)

diff --git a/lib/flow.c b/lib/flow.c
index 8da9f3235d0a..39aed51837a6 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -2735,17 +2735,17 @@ flow_compose_l4_csum(struct dp_packet *p, const struct 
flow *flow,
 }
 }
 
-/* Tries to increase the size of packet composed by 'flow_compose' up to
- * 'size' bytes.  Fixes all the required packet headers like ip/udp lengths
- * and l3/l4 checksums. */
-void
-flow_compose_size(struct dp_packet *p, const struct flow *flow, size_t size)
+/* Increase the size of packet composed by 'flow_compose_minimal'
+ * up to 'size' bytes.  Fixes all the required packet headers like
+ * ip/udp lengths and l3/l4 checksums.
+ *
+ * 'size' needs to be larger then the current packet size.  */
+static void
+packet_expand(struct dp_packet *p, const struct flow *flow, size_t size)
 {
 size_t extra_size;
 
-if (size <= dp_packet_size(p)) {
-return;
-}
+ovs_assert(size > dp_packet_size(p));
 
 extra_size = size - dp_packet_size(p);
 dp_packet_put_zeros(p, extra_size);
@@ -2754,7 +2754,6 @@ flow_compose_size(struct dp_packet *p, const struct flow 
*flow, size_t size)
 struct eth_header *eth = dp_packet_eth(p);
 
 eth->eth_type = htons(dp_packet_size(p));
-
 } else if (dl_type_is_ip_any(flow->dl_type)) {
 uint32_t pseudo_hdr_csum;
 size_t l4_len = (char *) dp_packet_tail(p) - (char *) dp_packet_l4(p);
@@ -2789,9 +2788,12 @@ flow_compose_size(struct dp_packet *p, const struct flow 
*flow, size_t size)
  * 'flow'.
  *
  * (This is useful only for testing, obviously, and the packet isn't really
- * valid.  Lots of fields are just zeroed.) */
-void
-flow_compose(struct dp_packet *p, const struct flow *flow)
+ * valid.  Lots of fields are just zeroed.)
+ *
+ * The created packet will have minimal packet length, just large
+ * enough to hold the packet header fields.  */
+static void
+flow_compose_minimal(struct dp_packet *p, const struct flow *flow)
 {
 uint32_t pseudo_hdr_csum;
 size_t l4_len;
@@ -2896,6 +2898,33 @@ flow_compose(struct dp_packet *p, const struct flow 
*flow)
 }
 }
 }
+
+/* Puts into 'p' a Ethernet frame of size 'size' that flow_extract() would
+ * parse as having the given 'flow'.
+ *
+ * When 'size' is zero, 'p' is a minimal size packet that only big enough
+ * to contains all packet headers.
+ *
+ * When 'size' is larger than the minimal packet size, the packet will
+ * be expended to 'size' with the payload set to zero.
+ *
+ * Return 'true' if the packet is successfully created. 'false' otherwise.
+ * Note, when 'size' is set to zero, this function always returns true.  */
+bool
+flow_compose(struct dp_packet *p, const struct flow *flow, size_t size)
+{
+flow_compose_minimal(p, flow);
+
+if (size && size < dp_packet_size(p)) {
+return false;
+}
+
+if (size > dp_packet_size(p)) {
+packet_expand(p, flow, size);
+}
+
+return true;
+}
 
 /* Compressed flow. */
 
diff --git a/lib/flow.h b/lib/flow.h
index 1bbbe410c6d2..0c6069c66c74 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -124,8 +124,7 @@ void flow_set_mpls_tc(struct flow *, int idx, uint8_t tc);
 void flow_set_mpls_bos(struct flow *, int idx, uint8_t stack);
 void flow_set_mpls_lse(struct flow *, int idx, ovs_be32 lse);
 
-void flow_compose(struct dp_packet *, const struct flow *);
-void flow_compose_size(struct dp_packet *, const struct flow *, size_t size);
+bool flow_compose(struct dp_packet *, const struct flow *, size_t);
 
 bool parse_ipv6_ext_hdrs(const void **datap, size_t *sizep, uint8_t *nw_proto,
  uint8_t *nw_frag);
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 83e30b37cbc3..6e110b1c7376 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -1478,8 +1478,11 @@ eth_from_flow(const char *s, size_t packet_size)
 }
 
 packet = dp_packet_new(0);
-flow_compose(packet, &flow);
-flow_compose_size(packet, &flow, packet_size);
+if (!flow_compose(packet, &flow, packet_size)) {
+dp_packet_uninit(packet);
+free(packet);
+packet = NULL;
+};
 
 ofpbuf_uninit(&odp_key);
 return packet;
diff --git a/ofproto/ofproto-dpif-trace.c b/ofproto/ofproto-dpif-trace.c
index b3f3cbc6a4ef..38d11002f290 10

Re: [ovs-dev] [PATCH v2 1/3] flow: Add flow_compose_size().

2017-07-25 Thread Andy Zhou
On Tue, Jul 25, 2017 at 6:02 AM, Ilya Maximets  wrote:
> This allows to compose packets with different real lenghts from
> odp flows i.e. memory will be allocated for requested packet
> size and all required headers like ip->tot_len filled correctly.
>
> Will be used in netdev-dummy to properly handle '--len' option.
>
> Suggested-by: Andy Zhou 
> Signed-off-by: Ilya Maximets 
> ---

Thanks for the bug fixes. I have pushed this series to master.

I think the readability can be further improved. I have a follow up
patch at:

https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/336237.html
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Home Office en su Empresa

2017-07-25 Thread Aviso Importante
 

En línea y en Vivo / Para todo su Equipo con una sola Conexión 

Cómo Implementar el Home Office en su Empresa
10 de Agosto - Online en Vivo - 10:00 a 13:00hrs   
 
Gracias a los avances de la tecnología, trabajar a distancia se convirtió en 
una oportunidad tanto para las empresas como para los empleados. Ellos ahorran 
el gasto para moverse de su casa al trabajo y más en una ciudad como México 
donde una persona puede llevarse una hora o dos en trasladarse y esto repercute 
en la productividad y la energía de la gente.  

Conozca: 

1. Por qué es una práctica a nivel mundial. 

2. Por qué se sugiere en su empresa, 20 razones poderosas. 

3. Se puede aplicar con todo el personal.

4. Cuándo conviene convertir al personal home office en medio tiempos.

- Y mucho más. 




 
¿Requiere la información a la Brevedad?
responda este email con la palabra: Home.
Junto con los siguientes datos: 
Empresa:
Teléfono:N
Nombre.

centro telefónico:018002129393


 
Lic. Marisol Velasco
Coordinador de Eventos

¿Demasiados mensajes en su cuenta? Responda este mensaje indicando que solo 
desea recibir CALENDARIO y sólo recibirá un correo al mes. Si desea cancelar la 
suscripción, solicite su BAJA.
 

 

 



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


Re: [ovs-dev] [PATCH v3 0/2] basic encap/decap

2017-07-25 Thread Yang, Yi Y
Hi, folks

It seems Ben is out of office in these days, can anybody help review or merge 
this patch series? I heard 2.8 branch would be created end of July, but we 
still have NSH patch series waiting for review except this series.

-Original Message-
From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-boun...@openvswitch.org] 
On Behalf Of Zoltán Balogh
Sent: Saturday, July 22, 2017 1:08 AM
To: d...@openvswitch.org
Subject: [ovs-dev] [PATCH v3 0/2] basic encap/decap

From: Zoltan Balogh 

This series is a continuation of other patch series initiated by Jan Scheurich 
before. These were already applied to the master branch:
 - userspace: Support for L3 tunneling
   https://mail.openvswitch.org/pipermail/ovs-dev/2017-June/87.html
 - Packet type aware pipeline
   https://mail.openvswitch.org/pipermail/ovs-dev/2017-June/334512.html

The main purpose of this series is to add support for the OpenFlow actions 
generic encap and decap (ONF EXT-382) to the OVS control plane. It implements a 
skeleton for translation of generic encap and decap actions in ofproto-dpif and 
provides support to encap and decap an Ethernet header. 

v2->v3
 - NEWS updated.
 - fix: drop VLAN tagged packet trying to decap it.
 - New unit tests for the fix.
 - Some tests were updated due to change in recirculation on master branch.

v1->v2
 - Squash 1/4 and 2/4 commits of v1.
 - Put unit tests in a separate commit.
 - Use aligned cast.
 - Nicira extension numbers for encap/decap action numbers and error codes.
 - Small fixes according to comments.

Jan Scheurich (1):
  OF support and translation of generic encap and decap

Zoltan Balogh (1):
  tests: Extend PTAP unit tests with decap action

 NEWS   |   6 +
 include/openflow/openflow-common.h |   1 +
 include/openvswitch/automake.mk|   1 +
 include/openvswitch/ofp-actions.h  |  31 +++  
include/openvswitch/ofp-ed-props.h |  69 +++
 include/openvswitch/ofp-errors.h   |   9 +
 lib/automake.mk|   1 +
 lib/odp-util.c |  84 +---
 lib/odp-util.h |   3 +-
 lib/ofp-actions.c  | 378 +-
 lib/ofp-ed-props.c | 150 ++
 lib/packets.h  |   3 +-
 ofproto/ofproto-dpif-xlate.c   | 116 ++-
 tests/packet-type-aware.at | 405 +
 14 files changed, 1215 insertions(+), 42 deletions(-)  create mode 100644 
include/openvswitch/ofp-ed-props.h
 create mode 100644 lib/ofp-ed-props.c

--
1.9.1

___
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 v2 2/3] dpif-netdev: Avoid port's reconfiguration on pmd-cpu-mask changes.

2017-07-25 Thread Darrell Ball


-Original Message-
From: Ilya Maximets 
Date: Monday, July 24, 2017 at 4:58 AM
To: Darrell Ball , "d...@openvswitch.org" 

Cc: Heetae Ahn , Daniele Di Proietto 
, Ben Pfaff , Pravin Shelar 
, Ciara Loftus , Ian Stokes 
, Kevin Traynor 
Subject: Re: [PATCH v2 2/3] dpif-netdev: Avoid port's reconfiguration on 
pmd-cpu-mask changes.

On 23.07.2017 20:20, Darrell Ball wrote:
> Comments inline but this is mostly repetitive.
> 
> -Original Message-
> From: Ilya Maximets 
> Date: Monday, July 10, 2017 at 11:55 PM
> To: Darrell Ball , "d...@openvswitch.org" 

> Cc: Heetae Ahn , Daniele Di Proietto 
, Ben Pfaff , Pravin Shelar 
, Ciara Loftus , Ian Stokes 
, Kevin Traynor 
> Subject: Re: [PATCH v2 2/3] dpif-netdev: Avoid port's reconfiguration on 
pmd-cpu-mask changes.
> 
> On 11.07.2017 05:10, Darrell Ball wrote:
> > 
> > 
> > On 7/10/17, 12:41 AM, "Ilya Maximets"  
wrote:
> > 
> > On 07.07.2017 21:09, Darrell Ball wrote:
> > > 
> > > 
> > > On 7/6/17, 11:11 PM, "Ilya Maximets"  
wrote:
> > > 
> > > On 07.07.2017 08:08, Darrell Ball wrote:
> > > > 
> > > > 
> > > > On 5/30/17, 7:12 AM, "Ilya Maximets" 
 wrote:
> > > > 
> > > > Reconfiguration of HW NICs may lead to packet drops.
> > > > In current model all physical ports will be 
reconfigured each
> > > > time number of PMD threads changed. Since we not 
stopping
> > > > threads on pmd-cpu-mask changes, this patch will 
help to further
> > > > decrease port's downtime by setting the maximum 
possible number
> > > > of wanted tx queues to avoid unnecessary 
reconfigurations.
> > > > 
> > > > Signed-off-by: Ilya Maximets 

> > > > ---
> > > >  lib/dpif-netdev.c | 26 +-
> > > >  1 file changed, 21 insertions(+), 5 deletions(-)
> > > > 
> > > > diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> > > > index 596d133..79db770 100644
> > > > --- a/lib/dpif-netdev.c
> > > > +++ b/lib/dpif-netdev.c
> > > > @@ -3453,7 +3453,7 @@ reconfigure_datapath(struct 
dp_netdev *dp)
> > > >  {
> > > >  struct dp_netdev_pmd_thread *pmd;
> > > >  struct dp_netdev_port *port;
> > > > -int wanted_txqs;
> > > > +int needed_txqs, wanted_txqs;
> > > >  
> > > >  dp->last_reconfigure_seq = 
seq_read(dp->reconfigure_seq);
> > > >  
> > > > @@ -3461,7 +3461,15 @@ reconfigure_datapath(struct 
dp_netdev *dp)
> > > >   * on the system and the user configuration. */
> > > >  reconfigure_pmd_threads(dp);
> > > >  
> > > > -wanted_txqs = cmap_count(&dp->poll_threads);
> > > > +/* We need 1 Tx queue for each thread to avoid 
locking, but we will try
> > > > + * to allocate the maximum possible value to 
minimize the number of port
> > > > + * reconfigurations. */
> > > > +needed_txqs = cmap_count(&dp->poll_threads);
> > > > +/* (n_cores + 1) is the maximum that we might 
need to have.
> > > > + * Additional queue is for non-PMD threads. */
> > > > +wanted_txqs = ovs_numa_get_n_cores();
> > > > +ovs_assert(wanted_txqs != OVS_CORE_UNSPEC);
> > > > +wanted_txqs++;
> > > > 
> > > > I don’t think PMD mask changes are common, so this 
patch is trying to optimize a 
> > > > rare disruptive event that can/will be scheduled by the 
administrator.
> > > > 
> > > > Based on the actual number of queues supported and the 
number of cores present,
> > > > this optimization may or may not work. It is 
unpredictable whether there will be benefit
> > > > in a particular case from the user POV.
> > > > If I were the administrator, I would try to error on 
the conservative side anyways if I could
> > > > not predict the result.
> > > > 
> > > > Did I miss something ?
> > > 
> > > In NFV environment if you want to add one more VM to your 
hosts you will have to
> > > choose between:
> > > 
>

Re: [ovs-dev] [PATCH v4] Update relevant artifacts to add support for DPDK 17.05.1.

2017-07-25 Thread Darrell Ball
Hi Aaron

You had mentioned that you would be testing with the patch as well.
Were you able to try it ?

Thanks Darrell



-Original Message-
From:  on behalf of Kevin Traynor 

Organization: Red Hat
Date: Tuesday, July 25, 2017 at 9:35 AM
To: Michal Weglicki , "d...@openvswitch.org" 

Subject: Re: [ovs-dev] [PATCH v4] Update relevant artifacts to add support for 
DPDK 17.05.1.

On 07/25/2017 01:34 PM, Michal Weglicki wrote:
> Upgrading to DPDK 17.05.1 stable release adds new
> significant features relevant to OVS, including,
> but not limited to:
> - tun/tap PMD,
> - VFIO hotplug support,
> - Generic flow API.
> 
> Following changes are applied:
> - netdev-dpdk: Changes required by DPDK API modifications.
> - doc: Because of DPDK API changes, backward compatibility
>   with previous DPDK releases will be broken, thus all
>   relevant documentation entries are updated.
> - .travis: DPDK version change from 16.11.1 to 17.05.1.
> - rhel/openvswitch-fedora.spec.in: DPDK version change
>   from 16.11 to 17.05.1
> 
> v1->v2: Patch rebase.
> v2->v3: Fixed wrong formating after v2 patch rebase.
> v3->v4: Minor documentation changes.
> 
> Signed-off-by: Michal Weglicki 
> Reviewed-by: Aaron Conole 
> ---

Thanks Michal. I tried a few things out and working ok for me.

Acked-by: Kevin Traynor 
___
dev mailing list
d...@openvswitch.org

https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=ekKh60DEjO7sJHJqmg8W8agp2GxZlvAzz5bWGN3ux4k&s=AZOPEg-J3gwSlEr1nLn9aCrmRt_LBA0YK88h9QS1_-g&e=
 


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


[ovs-dev] [patch_v1] dpdk: Fix device cleanup.

2017-07-25 Thread Darrell Ball
Commit 5dcde09c80a8 was introduced to make detaching more
automatic without using an additional command.

Sometimes, since commit 5dcde09c80a8, dpdk devices are
not detached when del-port is issued; command example:

sudo ovs-vsctl del-port br0 dpdk1

This can happen when vswitchd is (re)started with an existing
database and devices are already bound to dpdk.

A discussion is here:
https://mail.openvswitch.org/pipermail/ovs-dev/2017-June/333462.html
along with a possible solution.

Since we are nearing the end of a release, a safe approach is needed,
at this time.
One approach is to revert 5dcde09c80a8.  This patch does not do that
but reinstates the command ovs-appctl netdev-dpdk/detach to handle
cases when del-port will not work.

Fixes: 5dcde09c80a8 ("netdev-dpdk: Fix device leak on port deletion.")
CC: Ilya Maximets 
Signed-off-by: Darrell Ball 
---
 Documentation/howto/dpdk.rst | 12 ++
 lib/netdev-dpdk.c| 52 +++-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst
index af01d3e..3c198a2 100644
--- a/Documentation/howto/dpdk.rst
+++ b/Documentation/howto/dpdk.rst
@@ -331,6 +331,18 @@ Detaching will be performed while processing del-port 
command::
 
 $ ovs-vsctl del-port dpdkx
 
+Sometimes, the del-port command may not detach the device.
+Detaching can be confirmed by the appearance of an INFO log.
+For example::
+
+Device ':04:00.0' has been detached
+
+If the log is not seen, then the port can be detached using::
+
+$ ovs-appctl netdev-dpdk/detach :01:00.0
+
+Again, detaching can be confirmed by the above INFO log.
+
 This feature is not supported with VFIO and does not work with some NICs.
 For more information please refer to the `DPDK Port Hotplug Framework
 `__.
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index ea17b97..812d262 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1013,7 +1013,7 @@ netdev_dpdk_destruct(struct netdev *netdev)
 if (rte_eth_dev_detach(dev->port_id, devname) < 0) {
 VLOG_ERR("Device '%s' can not be detached", dev->devargs);
 } else {
-VLOG_INFO("Device '%s' detached", devname);
+VLOG_INFO("Device '%s' has been detached", devname);
 }
 }
 
@@ -2449,6 +2449,53 @@ netdev_dpdk_set_admin_state(struct unixctl_conn *conn, 
int argc,
 unixctl_command_reply(conn, "OK");
 }
 
+static void
+netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED,
+   const char *argv[], void *aux OVS_UNUSED)
+{
+int ret;
+char *response;
+uint8_t port_id;
+char devname[RTE_ETH_NAME_MAX_LEN];
+struct netdev_dpdk *dev;
+
+ovs_mutex_lock(&dpdk_mutex);
+
+if (!rte_eth_dev_count() || rte_eth_dev_get_port_by_name(argv[1],
+ &port_id)) {
+response = xasprintf("Device '%s' not found in DPDK", argv[1]);
+goto error;
+}
+
+dev = netdev_dpdk_lookup_by_port_id(port_id);
+if (dev) {
+response = xasprintf("Device '%s' is being used by interface '%s'. "
+ "Remove it before detaching",
+ argv[1], netdev_get_name(&dev->up));
+goto error;
+}
+
+rte_eth_dev_close(port_id);
+
+ret = rte_eth_dev_detach(port_id, devname);
+if (ret < 0) {
+response = xasprintf("Device '%s' can not be detached", argv[1]);
+goto error;
+}
+
+response = xasprintf("Device '%s' has been detached", argv[1]);
+
+ovs_mutex_unlock(&dpdk_mutex);
+unixctl_command_reply(conn, response);
+free(response);
+return;
+
+error:
+ovs_mutex_unlock(&dpdk_mutex);
+unixctl_command_reply_error(conn, response);
+free(response);
+}
+
 /*
  * Set virtqueue flags so that we do not receive interrupts.
  */
@@ -2724,6 +2771,9 @@ netdev_dpdk_class_init(void)
 unixctl_command_register("netdev-dpdk/set-admin-state",
  "[netdev] up|down", 1, 2,
  netdev_dpdk_set_admin_state, NULL);
+unixctl_command_register("netdev-dpdk/detach",
+ "pci address of device", 1, 1,
+ netdev_dpdk_detach, NULL);
 
 ovsthread_once_done(&once);
 }
-- 
1.9.1

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


[ovs-dev] Openvswitch crash when bringing down the dpdk bond port using "ovs-ofctl mod-port br-prv dpdk1 down"

2017-07-25 Thread Keshav Gupta
Hi
  We are experiencing a openvswitch crash when bringing down the dpdk bond port 
using "ovs-ofctl mod-port br-prv dpdk1 down".

backtrace of core is like below. Is there any issue reported earlier  for this 
type of crash in openvswitch community.

(gdb) bt
#0  ixgbe_rxq_rearm (rxq=0x7fa45061f800) at 
/home/sdn/new_cloud_sdn_switch_2/cloud-sdn-switch/dpdk/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c:98
#1  _recv_raw_pkts_vec (split_packet=0x0, nb_pkts=32, rx_pkts=, 
rxq=0x7fa45061f800)
at 
/home/sdn/new_cloud_sdn_switch_2/cloud-sdn-switch/dpdk/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c:290
#2  ixgbe_recv_pkts_vec (rx_queue=0x7fa45061f800, rx_pkts=, 
nb_pkts=)
at 
/home/sdn/new_cloud_sdn_switch_2/cloud-sdn-switch/dpdk/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c:474
#3  0x00e500e4 in ?? ()
#4  0x004600e6 in ?? ()
#5  0x006a0069 in ?? ()
#6  0x006c006b in ?? ()
#7  0x00ec006d in ?? ()
#8  0x00ee00ed in ?? ()
#9  0x0001537f5780 in ?? ()
#10 0x in ?? ()
(gdb)


I have analyzed the core and it seems it is a result of device stop and packet 
receive from the port happening at same time by two thread
OVS main thread(device stop) and PMD thread(pkt receive). More precisely main 
thread cleaning the packet buffer from rxq sw_ring to avoid the
packet buffer leak while in parallel PMD thread is filling the packet buffer in 
sw_ring/descriptor ring as part of ixgbe_recv_pkts_vec.

version used is: openvswitch (2.6.1) with dpdk (16.11).

This crash is not every time reproducible but frequency seems to be high.

I am new to openvswitch community and this is first time I am posting a query. 
let me know if anything you require from my side.

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