[ovs-dev] 答复: Re: 答复: Re: 答复: Re: [PATCH] ovn: Support for taas(tap-as-a-service) function
If we do not add a new type of switch, we should write flag to a reg to indicate the matched packets which are cloned to monitor. This reg should add to all the pipeline stages of logical switch(both ingress and egress) to distinguish from normal flow. Is this right for Russell's point? If we add a new type of switch, we could define a new pipeline like bellow for the monitor function, this have no influence on normal pipeline. /* Logical mirror switch ingress stages. */ \ PIPELINE_STAGE(MSWITCH, IN, MIRROR_IN, 0, "lms_in_port") \ PIPELINE_STAGE(MSWITCH, IN, FLOW_FILTER, 1, "lms_in_flow_filter")\ PIPELINE_STAGE(MSWITCH, IN, OUT_LK, 2, "lms_in_out_lk") \ \ /* Logical mirror switch egress stages. */\ PIPELINE_STAGE(MSWITCH, OUT, FLOW_FILTER, 0, "lms_out_flow_filter")\ PIPELINE_STAGE(MSWITCH, OUT, DELIVERY,1, "lms_out_delivery") I think the new defined switch is easy to understand. Thanks Ben Pfaff2017/08/07 11:03 收件人:wang.qia...@zte.com.cn, 抄送: Russell Bryant , ovs dev , zhou.huij...@zte.com.cn, xurong00037997 , Miguel Angel Ajo Pelayo 主题: Re: [ovs-dev] 答复: Re: 答复: Re: [PATCH] ovn: Support for taas(tap-as-a-service) function I am having a very hard time understanding what you're writing here. Russell's point makes sense to me, but I don't understand your response. Can you give some examples? On Mon, Aug 07, 2017 at 09:40:06AM +0800, wang.qia...@zte.com.cn wrote: > Not add new logical_mirror_switch, just use logical_switch of course can > capture the use case. But logical_switch pipeline is complex for flow > monitor. Flow monitor should ignore some tables such as port_security, lb > and so on. And also should consider normal function for normal ports. I > think add a new type of switch and the corresponding pipeline may be more > clear in logical. > > Is there some adverse effect to add new type switch? > > Thanks. > > > > > Russell Bryant > 2017/08/04 22:06 > > 收件人:wang.qia...@zte.com.cn, > 抄送: Miguel Angel Ajo Pelayo , ovs dev > , xurong00037997 , > zhou.huij...@zte.com.cn > 主题: Re: 答复: Re: [ovs-dev] [PATCH] ovn: Support for > taas(tap-as-a-service) function > > > > > On Thu, Aug 3, 2017 at 8:52 PM, wrote: > Miguel Ángel and Russell > > Thanks for your reviews. > > Current taas function just for port monitor, in this situation, we can > simplify the design by just add new port type. But we have the plane to > add flow_classifier to tap_flow to monitor special flows of given port. > The flow_classifier definition may like as follow: > 'flow_classifiers': { > 'id': {'allow_post': False, 'allow_put': False, >'validate': {'type:uuid': None}, 'is_visible': True, >'primary_key': True}, > 'tenant_id': {'allow_post': True, 'allow_put': False, > 'validate': {'type:string': None}, > 'required_by_policy': True, 'is_visible': True}, > 'name': {'allow_post': True, 'allow_put': True, > 'validate': {'type:string': None}, > 'is_visible': True, 'default': ''}, > 'description': {'allow_post': True, 'allow_put': True, > 'validate': {'type:string': None}, > 'is_visible': True, 'default': ''}, > 'protocol': {'allow_post': True, 'allow_put': True, > 'validate': {'type:string': None}, > 'is_visible': True, 'default': ''}, > 'src_port_range_min': {'allow_post': True, 'allow_put': True, >'convert_to': attr.convert_to_int, >'is_visible': True, 'default': 0}, > 'src_port_range_max': {'allow_post': True, 'allow_put': True, >'convert_to': attr.convert_to_int, >'is_visible': True, 'default': 0}, > 'dst_port_range_min': {'allow_post': True, 'allow_put': True, >'convert_to': attr.convert_to_int, >'is_visible': True, 'default': 0}, > 'dst_port_range_max': {'allow_post': True, 'allow_put': True, >'convert_to': attr.convert_to_int, >'is_visible': True, 'default': 0}, > 'src_ip_prefix': {'allow_post': True, 'allow_put': True, > 'validate': {'type:subnet': > attr._validate_subnet}, > 'is_visible': True, 'default': '0.0.0.0/0'}, > 'dst_ip_prefix': {'allow_post':
Re: [ovs-dev] [PATCH v3 6/6] dpif-netdev: Flush the packets in intermediate queue.
-Original Message- From:on behalf of Bhanuprakash Bodireddy Date: Thursday, June 29, 2017 at 3:39 PM To: "d...@openvswitch.org" Subject: [ovs-dev] [PATCH v3 6/6] dpif-netdev: Flush the packets in intermediate queue. Under low rate traffic conditions, there can be 2 issues. (1) Packets potentially can get stuck in the intermediate queue. (2) Latency of the packets can increase significantly due to buffering in intermediate queue. This commit handles the (1) issue by flushing the tx port queues from PMD processing loop. Also this commit addresses issue (2) by flushing the tx queues after every rxq port processing. This reduces the latency with out impacting the forwarding throughput. MASTER Pkt size min(ns) avg(ns) max(ns) 512 4,631 5,022309,914 1024 5,545 5,749104,294 1280 5,978 6,159 45,306 1518 6,419 6,774946,850 MASTER + COMMIT - Pkt size min(ns) avg(ns) max(ns) 512 4,711 5,064182,477 1024 5,601 5,888701,654 1280 6,018 6,491533,037 1518 6,467 6,734312,471 PMDs can be teared down and spawned at runtime and so the rxq and txq mapping of the PMD threads can change. In few cases packets can get stuck in the queue due to reconfiguration and this commit helps flush the queues. Suggested-by: Eelco Chaudron Reported-at: https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_pipermail_ovs-2Ddev_2017-2DApril_331039.html=DwICAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=bHrBe9xQ4KZyIP8eXmMQgmAki-7TrHqH1PHcy7KBp9M=FLHjFbETDpuejnwNxIJem8vPtHo7KDb0q0YJSIpsMb8= Signed-off-by: Bhanuprakash Bodireddy Signed-off-by: Antonio Fischetti Co-authored-by: Antonio Fischetti Signed-off-by: Markus Magnusson Co-authored-by: Markus Magnusson Acked-by: Eelco Chaudron --- lib/dpif-netdev.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 7e1f5bc..f03bd3e 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3603,6 +3603,8 @@ dpif_netdev_run(struct dpif *dpif) for (i = 0; i < port->n_rxq; i++) { dp_netdev_process_rxq_port(non_pmd, port->rxqs[i].rx, port->port_no); + +dp_netdev_flush_txq_ports(non_pmd); Is this a temporary change ?; seems counter to the objective ? Should be latency based, as discussed on another thread couple months ago ?; configurable by port type and port ? } } } @@ -3760,6 +3762,8 @@ reload: for (i = 0; i < poll_cnt; i++) { dp_netdev_process_rxq_port(pmd, poll_list[i].rx, poll_list[i].port_no); + +dp_netdev_flush_txq_ports(pmd); } Same comment as above. if (lc++ > 1024) { @@ -3780,6 +3784,9 @@ reload: } } +/* Flush the queues as part of reconfiguration logic. */ +dp_netdev_flush_txq_ports(pmd); + poll_cnt = pmd_load_queues_and_ports(pmd, _list); exiting = latch_is_set(>exit_latch); /* Signal here to make sure the pmd finishes -- 2.4.11 ___ dev mailing list d...@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev=DwICAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=bHrBe9xQ4KZyIP8eXmMQgmAki-7TrHqH1PHcy7KBp9M=9f249RikCnGphA_CpKIFbbtkbo2W6axBPaub91khHeM= ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v3 4/6] netdev-dpdk: Add intermediate queue support.
-Original Message- From:on behalf of Bhanuprakash Bodireddy Date: Thursday, June 29, 2017 at 3:39 PM To: "d...@openvswitch.org" Subject: [ovs-dev] [PATCH v3 4/6] netdev-dpdk: Add intermediate queue support. This commit introduces netdev_dpdk_eth_tx_queue() function that implements intermediate queue and packet buffering. The packets get buffered till the threshold 'INTERIM_QUEUE_BURST_THRESHOLD[32] is reached and eventually gets transmitted. To handle the case(eg: ping) where packets are sent at low rate and can potentially get stuck in the queue, flush logic is implemented that gets invoked from dp_netdev_flush_txq_ports() as part of PMD packet processing loop. Signed-off-by: Bhanuprakash Bodireddy Signed-off-by: Antonio Fischetti Co-authored-by: Antonio Fischetti Signed-off-by: Markus Magnusson Co-authored-by: Markus Magnusson Acked-by: Eelco Chaudron --- lib/dpif-netdev.c | 44 +++- lib/netdev-dpdk.c | 37 +++-- 2 files changed, 78 insertions(+), 3 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 4e29085..7e1f5bc 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -332,6 +332,7 @@ enum pmd_cycles_counter_type { }; #define XPS_TIMEOUT_MS 500LL +#define LAST_USED_QID_NONE -1 /* Contained by struct dp_netdev_port's 'rxqs' member. */ struct dp_netdev_rxq { @@ -492,7 +493,13 @@ struct rxq_poll { struct tx_port { struct dp_netdev_port *port; int qid; -long long last_used; +int last_used_qid;/* Last queue id where packets got + enqueued. */ +long long last_used; /* In case XPS is enabled, it contains the + * timestamp of the last time the port was + * used by the thread to send data. After + * XPS_TIMEOUT_MS elapses the qid will be + * marked as -1. */ struct hmap_node node; }; @@ -3080,6 +3087,25 @@ cycles_count_end(struct dp_netdev_pmd_thread *pmd, } static void +dp_netdev_flush_txq_ports(struct dp_netdev_pmd_thread *pmd) +{ +struct tx_port *cached_tx_port; +int tx_qid; + +HMAP_FOR_EACH (cached_tx_port, node, >send_port_cache) { +tx_qid = cached_tx_port->last_used_qid; + +if (tx_qid != LAST_USED_QID_NONE) { +netdev_txq_flush(cached_tx_port->port->netdev, tx_qid, + cached_tx_port->port->dynamic_txqs); + +/* Queue flushed and mark it empty. */ +cached_tx_port->last_used_qid = LAST_USED_QID_NONE; +} +} +} + Could you move this function and I think the other code in dpif-netdev.c to patch 6, if you can ? This function is unused, so will generate a build error with –Werror when applied in sequence and logically this seems like it can go into patch 6. Darrell +static void dp_netdev_process_rxq_port(struct dp_netdev_pmd_thread *pmd, struct netdev_rxq *rx, odp_port_t port_no) @@ -4355,6 +4381,7 @@ dp_netdev_add_port_tx_to_pmd(struct dp_netdev_pmd_thread *pmd, tx->port = port; tx->qid = -1; +tx->last_used_qid = LAST_USED_QID_NONE; hmap_insert(>tx_ports, >node, hash_port_no(tx->port->port_no)); pmd->need_reload = true; @@ -4925,6 +4952,14 @@ dpif_netdev_xps_get_tx_qid(const struct dp_netdev_pmd_thread *pmd, dpif_netdev_xps_revalidate_pmd(pmd, now, false); +/* The tx queue can change in XPS case, make sure packets in previous + * queue is flushed properly. */ +if (tx->last_used_qid != LAST_USED_QID_NONE && + tx->qid != tx->last_used_qid) { +netdev_txq_flush(port->netdev, tx->last_used_qid, port->dynamic_txqs); +tx->last_used_qid = LAST_USED_QID_NONE; +} + VLOG_DBG("Core %d: New TX queue ID %d for port \'%s\'.", pmd->core_id, tx->qid, netdev_get_name(tx->port->netdev)); return min_qid; @@ -5020,6 +5055,13 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_, tx_qid = pmd->static_tx_qid; } +/* In case these packets gets buffered into an intermediate + * queue and XPS is enabled the flush
Re: [ovs-dev] [PATCH v3 2/6] netdev-dpdk: Add netdev_dpdk_txq_flush function.
Hi Bhanu Would it be possible to combine patches 1 and 2, rather than initially defining an empty netdev_txq_flush for dpdk ? I think the combined patch would have more context. Darrell -Original Message- From:on behalf of Bhanuprakash Bodireddy Date: Thursday, June 29, 2017 at 3:39 PM To: "d...@openvswitch.org" Subject: [ovs-dev] [PATCH v3 2/6] netdev-dpdk: Add netdev_dpdk_txq_flush function. This commit adds netdev_dpdk_txq_flush() function. If there are any packets waiting in the queue, they are transmitted instantly using the rte_eth_tx_burst function. In XPS enabled case, lock is taken on the tx queue before flushing the queue. Signed-off-by: Bhanuprakash Bodireddy Signed-off-by: Antonio Fischetti Co-authored-by: Antonio Fischetti Signed-off-by: Markus Magnusson Co-authored-by: Markus Magnusson Acked-by: Eelco Chaudron --- lib/netdev-dpdk.c | 31 +-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 9ca4433..dd42716 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -293,6 +293,11 @@ struct dpdk_mp { struct ovs_list list_node OVS_GUARDED_BY(dpdk_mp_mutex); }; +/* Queue 'INTERIM_QUEUE_BURST_THRESHOLD' packets before transmitting. + * Defaults to 'NETDEV_MAX_BURST'(32) packets. + */ +#define INTERIM_QUEUE_BURST_THRESHOLD NETDEV_MAX_BURST + /* There should be one 'struct dpdk_tx_queue' created for * each cpu core. */ struct dpdk_tx_queue { @@ -302,6 +307,12 @@ struct dpdk_tx_queue { * pmd threads (see 'concurrent_txq'). */ int map; /* Mapping of configured vhost-user queues * to enabled by guest. */ +int dpdk_pkt_cnt; /* Number of buffered packets waiting to + be sent on DPDK tx queue. */ +struct rte_mbuf *dpdk_burst_pkts[INTERIM_QUEUE_BURST_THRESHOLD]; + /* Intermediate queue where packets can +* be buffered to amortize the cost of MMIO +* writes. */ }; /* dpdk has no way to remove dpdk ring ethernet devices @@ -1897,9 +1908,25 @@ netdev_dpdk_send__(struct netdev_dpdk *dev, int qid, * few packets (< INTERIM_QUEUE_BURST_THRESHOLD) buffered in the queue. */ static int -netdev_dpdk_txq_flush(struct netdev *netdev OVS_UNUSED, - int qid OVS_UNUSED, bool concurrent_txq OVS_UNUSED) +netdev_dpdk_txq_flush(struct netdev *netdev, + int qid, bool concurrent_txq) { +struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); +struct dpdk_tx_queue *txq = >tx_q[qid]; + +if (OVS_LIKELY(txq->dpdk_pkt_cnt)) { +if (OVS_UNLIKELY(concurrent_txq)) { +qid = qid % dev->up.n_txq; +rte_spinlock_lock(>tx_q[qid].tx_lock); +} + +netdev_dpdk_eth_tx_burst(dev, qid, txq->dpdk_burst_pkts, + txq->dpdk_pkt_cnt); + +if (OVS_UNLIKELY(concurrent_txq)) { +rte_spinlock_unlock(>tx_q[qid].tx_lock); +} +} return 0; } -- 2.4.11 ___ dev mailing list d...@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev=DwICAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=1wUGGHlSVXpqn5THs-saPYXoqzsKYA6zy3m0dzrOr5c=HDVtHRNK1uhmuU70EfLAxfXvZXasjTmO8b8zpS7M9t4= ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 1/2] netdev-vport: Always implement get_ifindex for netdev-vport
From: Paul BlakeyAlways implement get_ifindex without checking if offload is enabled or not as this should not be related. From ovs-dpctl we cannot tell if offload is enabled or not as other_config is not being read. Signed-off-by: Paul Blakey Reviewed-by: Roi Dayan --- lib/netdev-vport.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 64a3ba3..d11c5cc 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -857,7 +857,7 @@ get_pt_mode(const struct netdev *netdev) #ifdef __linux__ static int -netdev_vport_get_ifindex__(const struct netdev *netdev_) +netdev_vport_get_ifindex(const struct netdev *netdev_) { char buf[NETDEV_VPORT_NAME_BUFSIZE]; const char *name = netdev_vport_get_dpif_port(netdev_, buf, sizeof(buf)); @@ -865,15 +865,6 @@ netdev_vport_get_ifindex__(const struct netdev *netdev_) return linux_get_ifindex(name); } -static int -netdev_vport_get_ifindex(const struct netdev *netdev_) -{ -if (netdev_is_flow_api_enabled()) -return netdev_vport_get_ifindex__(netdev_); -else -return -EOPNOTSUPP; -} - #define NETDEV_VPORT_GET_IFINDEX netdev_vport_get_ifindex #define NETDEV_FLOW_OFFLOAD_API LINUX_FLOW_OFFLOAD_API #else /* !__linux__ */ -- 2.8.0 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] 答复: Re: 答复: Re: [PATCH] ovn: Support for taas(tap-as-a-service) function
Not add new logical_mirror_switch, just use logical_switch of course can capture the use case. But logical_switch pipeline is complex for flow monitor. Flow monitor should ignore some tables such as port_security, lb and so on. And also should consider normal function for normal ports. I think add a new type of switch and the corresponding pipeline may be more clear in logical. Is there some adverse effect to add new type switch? Thanks. Russell Bryant2017/08/04 22:06 收件人:wang.qia...@zte.com.cn, 抄送: Miguel Angel Ajo Pelayo , ovs dev , xurong00037997 , zhou.huij...@zte.com.cn 主题: Re: 答复: Re: [ovs-dev] [PATCH] ovn: Support for taas(tap-as-a-service) function On Thu, Aug 3, 2017 at 8:52 PM, wrote: Miguel Ángel and Russell Thanks for your reviews. Current taas function just for port monitor, in this situation, we can simplify the design by just add new port type. But we have the plane to add flow_classifier to tap_flow to monitor special flows of given port. The flow_classifier definition may like as follow: 'flow_classifiers': { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True, 'primary_key': True}, 'tenant_id': {'allow_post': True, 'allow_put': False, 'validate': {'type:string': None}, 'required_by_policy': True, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': None}, 'is_visible': True, 'default': ''}, 'description': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': None}, 'is_visible': True, 'default': ''}, 'protocol': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': None}, 'is_visible': True, 'default': ''}, 'src_port_range_min': {'allow_post': True, 'allow_put': True, 'convert_to': attr.convert_to_int, 'is_visible': True, 'default': 0}, 'src_port_range_max': {'allow_post': True, 'allow_put': True, 'convert_to': attr.convert_to_int, 'is_visible': True, 'default': 0}, 'dst_port_range_min': {'allow_post': True, 'allow_put': True, 'convert_to': attr.convert_to_int, 'is_visible': True, 'default': 0}, 'dst_port_range_max': {'allow_post': True, 'allow_put': True, 'convert_to': attr.convert_to_int, 'is_visible': True, 'default': 0}, 'src_ip_prefix': {'allow_post': True, 'allow_put': True, 'validate': {'type:subnet': attr._validate_subnet}, 'is_visible': True, 'default': '0.0.0.0/0'}, 'dst_ip_prefix': {'allow_post': True, 'allow_put': True, 'validate': {'type:subnet': attr._validate_subnet}, 'is_visible': True, 'default': '0.0.0.0/0'} } This may need more complex pipeline. So I think add a new table and new pipeline may be a easier way. Thanks for sharing the info on future capabilities. We have a very flexible syntax for traffic classification in OVN. It's the logical flow match syntax (see logical flows in the southbound database). We expose this syntax in the northbound database in the "match" column of the ACL table. This would be another use case where we could use this syntax in the northbound database. Expanding on my preview proposal: - a new port type of 'mirror' - when port type=mirror, an option to identify which port is being mirrored - (the new part) when port type=mirror, an option that may be used to specify traffic classification for the subset of traffic on a port to mirror, in "match" syntax Do you think this captures the use case? -- Russell Bryant ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [patch_v11 5/7] System tests: Enable ALGs for userspace.
Signed-off-by: Darrell Ball--- tests/system-userspace-macros.at | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/system-userspace-macros.at b/tests/system-userspace-macros.at index 3fc4ef9..f3337f0 100644 --- a/tests/system-userspace-macros.at +++ b/tests/system-userspace-macros.at @@ -69,12 +69,9 @@ m4_define([CHECK_CONNTRACK], # CHECK_CONNTRACK_ALG() # # Perform requirements checks for running conntrack ALG tests. The userspace -# doesn't support ALGs yet, so skip the tests +# supports FTP and TFTP. # -m4_define([CHECK_CONNTRACK_ALG], -[ -AT_SKIP_IF([:]) -]) +m4_define([CHECK_CONNTRACK_ALG]) # CHECK_CONNTRACK_FRAG() # -- 1.9.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [patch_v11 1/7] string: Implement strcasestr for Windows.
strcasestr is not defined for Windows, so implement a version that could be used on Windows. This is needed for an upcoming patch. Signed-off-by: Darrell BallCo-authored-by: Ben Pfaff Signed-off-by: Ben Pfaff --- lib/string.c| 22 -- lib/string.h.in | 3 ++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/string.c b/lib/string.c index 082359d..e7e265b 100644 --- a/lib/string.c +++ b/lib/string.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011 Nicira, Inc. + * Copyright (c) 2009, 2011, 2017 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,11 @@ */ #include - +#include #include +#include "util.h" + #ifndef HAVE_STRNLEN size_t strnlen(const char *s, size_t maxlen) @@ -26,3 +28,19 @@ strnlen(const char *s, size_t maxlen) return end ? end - s : maxlen; } #endif + +#ifdef _WIN32 +char *strcasestr(const char *str, const char *substr) +{ +do { +for (size_t i = 0; ; i++) { +if (!substr[i]) { +return CONST_CAST(char *, str); +} else if (tolower(substr[i]) != tolower(str[i])) { +break; +} +} +} while (*str++); +return NULL; +} +#endif diff --git a/lib/string.h.in b/lib/string.h.in index bbdaeb4..7a8e18f 100644 --- a/lib/string.h.in +++ b/lib/string.h.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, 2013 Nicira, Inc. + * Copyright (c) 2009, 2011, 2013, 2017 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ #define strcasecmp _stricmp #define strncasecmp _strnicmp #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum) +char *strcasestr(const char *, const char *); #endif #ifndef HAVE_STRNLEN -- 1.9.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v4 5/5] redhat: allow dpdk to also run as non-root user
Russell Bryantwrites: > On Fri, Aug 4, 2017 at 1:00 PM, Aaron Conole wrote: >> After this commit, users may start a dpdk-enabled ovs setup as a >> non-root user. This is accomplished by exporting the $HOME directory, >> which dpdk uses to fill in it's semi-persistent RTE configuration. >> >> This change may be a bit controversial since it modifies /dev/hugepages >> as part of starting the ovs-vswitchd to set a hugetlbfs group >> ownership. This is used to enable writing to /dev/hugepages so that the >> dpdk_init will successfully complete. There is an alternate way of >> accomplishing this - namely to initialize DPDK before dropping >> privileges. However, this would mean that if DPDK ever grows an uninit >> / reinit function, non-root ovs likely could never use it. > > Indeed ... the modifications to /dev/hugepages don't look ideal ... > > If this was truly limited to when DPDK was in use, I'd feel better > about it. We want to build a single package for OVS, right? The > package will have DPDK enabled, even for normal uses that won't use > DPDK. That means these modifications take place even for non-DPDK > use. I'd feel more comfortable if it could be restricted to only when > DPDK was actually in use. Maybe some of this logic could be moved > into ovs-ctl so that the check could be at runtime? I couldn't find a way of doing that check. It is possible to dynamically enable dpdk (since commit ec2b070143c2 "dpdk: Late initialization"), which means we would need something constantly polling for the status change -OR- we would need to have a way of changing gid in response to the database change. The second might be possible but would require some changes in ovs-vswitchd. >> >> This does not change OvS+DPDK's SELinux requirements. It still must be >> disabled. >> >> Signed-off-by: Aaron Conole >> --- >> Documentation/intro/install/dpdk.rst| 7 +++ >> NEWS| 1 + >> rhel/README.RHEL.rst| 11 +++ >> rhel/openvswitch-fedora.spec.in | 13 + >> rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | 5 + >> 5 files changed, 37 insertions(+) ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev