DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Kavanagh, Mark B" <mark.b.kavanagh@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: 'Ilya Maximets' <i.maximets@samsung.com>,
	'Daniele Di Proietto' <diproiettod@vmware.com>
Subject: Re: [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking	for internal ports.
Date: Fri, 5 Aug 2016 14:41:44 +0000	[thread overview]
Message-ID: <DC5AD7FA266D86499789B1BCAEC715F85C6D2CCC@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <1470407413-157932-1-git-send-email-mark.b.kavanagh@intel.com>

Please disregard this patchset - it was sent erroneously to the incorrect mailing list.

I've already removed the related patches from Patchwork.

Cheers,
Mark 

>-----Original Message-----
>From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mark Kavanagh
>Sent: Friday, August 5, 2016 3:30 PM
>To: dev@dpdk.org; diproiettod@vmware.com
>Cc: i.maximets@samsung.com
>Subject: [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal
>ports.
>
>From: Daniele Di Proietto <diproiettod@vmware.com>
>
>Interfaces with type "internal" end up having a netdev with type "tap"
>in the dpif-netdev datapath, so a strcmp will fail to match internal
>interfaces.
>
>We can translate the types with ofproto_port_open_type() before calling
>strcmp to fix this.
>
>This fixes a minor issue where internal interfaces are considered
>non-internal in the userspace datapath for the purpose of adjusting the
>MTU.
>
>Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
>---
> ofproto/ofproto.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
>diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
>index 8e59c69..088f91a 100644
>--- a/ofproto/ofproto.c
>+++ b/ofproto/ofproto.c
>@@ -220,7 +220,8 @@ static void learned_cookies_flush(struct ofproto *, struct ovs_list
>*dead_cookie
> /* ofport. */
> static void ofport_destroy__(struct ofport *) OVS_EXCLUDED(ofproto_mutex);
> static void ofport_destroy(struct ofport *, bool del);
>-static inline bool ofport_is_internal(const struct ofport *);
>+static inline bool ofport_is_internal(const struct ofproto *,
>+                                      const struct ofport *);
>
> static int update_port(struct ofproto *, const char *devname);
> static int init_ports(struct ofproto *);
>@@ -2465,7 +2466,7 @@ static void
> ofport_remove(struct ofport *ofport)
> {
>     struct ofproto *p = ofport->ofproto;
>-    bool is_internal = ofport_is_internal(ofport);
>+    bool is_internal = ofport_is_internal(p, ofport);
>
>     connmgr_send_port_status(ofport->ofproto->connmgr, NULL, &ofport->pp,
>                              OFPPR_DELETE);
>@@ -2751,9 +2752,10 @@ init_ports(struct ofproto *p)
> }
>
> static inline bool
>-ofport_is_internal(const struct ofport *port)
>+ofport_is_internal(const struct ofproto *p, const struct ofport *port)
> {
>-    return !strcmp(netdev_get_type(port->netdev), "internal");
>+    return !strcmp(netdev_get_type(port->netdev),
>+                   ofproto_port_open_type(p->type, "internal"));
> }
>
> /* Find the minimum MTU of all non-datapath devices attached to 'p'.
>@@ -2770,7 +2772,7 @@ find_min_mtu(struct ofproto *p)
>
>         /* Skip any internal ports, since that's what we're trying to
>          * set. */
>-        if (ofport_is_internal(ofport)) {
>+        if (ofport_is_internal(p, ofport)) {
>             continue;
>         }
>
>@@ -2797,7 +2799,7 @@ update_mtu(struct ofproto *p, struct ofport *port)
>         port->mtu = 0;
>         return;
>     }
>-    if (ofport_is_internal(port)) {
>+    if (ofport_is_internal(p, port)) {
>         if (dev_mtu > p->min_mtu) {
>            if (!netdev_set_mtu(port->netdev, p->min_mtu)) {
>                dev_mtu = p->min_mtu;
>@@ -2827,7 +2829,7 @@ update_mtu_ofproto(struct ofproto *p)
>     HMAP_FOR_EACH (ofport, hmap_node, &p->ports) {
>         struct netdev *netdev = ofport->netdev;
>
>-        if (ofport_is_internal(ofport)) {
>+        if (ofport_is_internal(p, ofport)) {
>             if (!netdev_set_mtu(netdev, p->min_mtu)) {
>                 ofport->mtu = p->min_mtu;
>             }
>--
>1.9.3

      parent reply	other threads:[~2016-08-05 14:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05 14:30 Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 2/7] vswitchd: Introduce 'mtu_request' column in Interface Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 3/7] netdev: Pass 'netdev_class' to ->run() and ->wait() Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 4/7] netdev-dummy: Add dummy-internal class Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 5/7] tests: Add a new MTU test Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 6/7] netdev: Make netdev_set_mtu() netdev parameter non-const Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 7/7] netdev-dpdk: add support for Jumbo Frames Mark Kavanagh
2016-08-05 14:41 ` Kavanagh, Mark B [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DC5AD7FA266D86499789B1BCAEC715F85C6D2CCC@irsmsx105.ger.corp.intel.com \
    --to=mark.b.kavanagh@intel.com \
    --cc=dev@dpdk.org \
    --cc=diproiettod@vmware.com \
    --cc=i.maximets@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).