get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/13056/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 13056,
    "url": "http://patches.dpdk.org/api/patches/13056/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1464378246-24097-2-git-send-email-ehkinzie@gmail.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1464378246-24097-2-git-send-email-ehkinzie@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1464378246-24097-2-git-send-email-ehkinzie@gmail.com",
    "date": "2016-05-27T19:44:05",
    "name": "[dpdk-dev,v2,1/2] bond mode 4: allow external state machine",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8f2d833fae6278f4ffdff5b981436dd0f2713360",
    "submitter": {
        "id": 208,
        "url": "http://patches.dpdk.org/api/people/208/?format=api",
        "name": "Eric Kinzie",
        "email": "ehkinzie@gmail.com"
    },
    "delegate": {
        "id": 10,
        "url": "http://patches.dpdk.org/api/users/10/?format=api",
        "username": "bruce",
        "first_name": "Bruce",
        "last_name": "Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1464378246-24097-2-git-send-email-ehkinzie@gmail.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/13056/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/13056/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 5E5CA5A45;\n\tFri, 27 May 2016 21:44:24 +0200 (CEST)",
            "from mail-io0-f194.google.com (mail-io0-f194.google.com\n\t[209.85.223.194]) by dpdk.org (Postfix) with ESMTP id 4FAAE5A31\n\tfor <dev@dpdk.org>; Fri, 27 May 2016 21:44:21 +0200 (CEST)",
            "by mail-io0-f194.google.com with SMTP id d197so6046759ioe.1\n\tfor <dev@dpdk.org>; Fri, 27 May 2016 12:44:21 -0700 (PDT)",
            "from buildhost2.vyatta.com. ([144.49.197.22])\n\tby smtp.gmail.com with ESMTPSA id\n\th38sm2073051ioi.25.2016.05.27.12.44.18 for <dev@dpdk.org>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 27 May 2016 12:44:19 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=from:to:subject:date:message-id:in-reply-to:references;\n\tbh=/8RddtfakNRY3Vi35fossO0ysR0yEr6tBWc3H0VZ5vI=;\n\tb=rRpJtjdECwpF8Ioeuqnd5XVUtEAxijxjXl0hKmHbQ+xAQKsVAGlpHj/VGTXq1neSNn\n\tVTcBQLq7HlCmGuAeJyEzY2CY1YK2+xZxrkEfp9q5Z5tr4XKyJnpQBrVs+ArB+SNNIIyk\n\thsM9oOMAuEG6t9tc9gFX/6AfWHj59SkHNSle6uLPLM4zSLc6jzS7Rlt4rCfSE16KupxI\n\tdiBqEWkyPQdgP7h6JOofo5j/TUAxDXeG3NNMi4neg29r+b0bjiAOUqvp9hcz3pe47B77\n\tZdIkz7MCaLphg/hSxWWGgyEUF79jr+d3cWZXO8TE1jI8LnnfwM+67s8lqkrs4Xd6isVq\n\t+EBA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=/8RddtfakNRY3Vi35fossO0ysR0yEr6tBWc3H0VZ5vI=;\n\tb=jNS18LjeaFLiolVzC99ZDermZGap+DXqrCu6s7QBioRZHN2BVL+hmHXs4lLgLyAiZM\n\t0ZFzTExnbmueyfRBNn6SOy3aeP/x1+HTAONjNb7TqVZ9+elt4dfdjEAExt3rsijUZzKu\n\tcfA1sKz8ThzXNpkL+r9wm+0wvA4gMfCCINtDkGWjvApyahAP750ah1MrSghxTn0tlG0d\n\tBdSaTWpHJbjHF3hW4160Y/BXRQULOlzlFLCSD952TvnHM2sXV8Mog21/rdIne9aEMvEy\n\trVwinL9WGjseEMYrkR/32SrpKVe0AnPUhg8ZrW070Qqf5vyR3u0UWLou7MpP4jLhbipL\n\t50kw==",
        "X-Gm-Message-State": "ALyK8tL68ZCe8oEoPC8k4IwzlLLKHxwHWEcOfd/m+CtXxwTBSQaN5EArV5LCeqq4ddOEyQ==",
        "X-Received": "by 10.107.187.196 with SMTP id\n\tl187mr15126425iof.72.1464378260627; \n\tFri, 27 May 2016 12:44:20 -0700 (PDT)",
        "From": "Eric Kinzie <ehkinzie@gmail.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 27 May 2016 12:44:05 -0700",
        "Message-Id": "<1464378246-24097-2-git-send-email-ehkinzie@gmail.com>",
        "X-Mailer": "git-send-email 1.7.10.4",
        "In-Reply-To": "<1464378246-24097-1-git-send-email-ehkinzie@gmail.com>",
        "References": "<1464315851-12953-1-git-send-email-ehkinzie@gmail.com>\n\t<1464378246-24097-1-git-send-email-ehkinzie@gmail.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] bond mode 4: allow external state machine",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Provide functions to allow an external 802.3ad state machine to transmit\nand recieve LACPDUs and to set the collection/distribution flags on\nslave interfaces.\n\nSigned-off-by: Eric Kinzie <ehkinzie@gmail.com>\n---\n drivers/net/bonding/rte_eth_bond_8023ad.c         |  323 +++++++++++++++++++--\n drivers/net/bonding/rte_eth_bond_8023ad.h         |   83 ++++++\n drivers/net/bonding/rte_eth_bond_8023ad_private.h |   14 +-\n drivers/net/bonding/rte_eth_bond_version.map      |   16 +\n 4 files changed, 404 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c\nindex c0ed44d..48a50e4 100644\n--- a/drivers/net/bonding/rte_eth_bond_8023ad.c\n+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c\n@@ -39,9 +39,12 @@\n #include <rte_malloc.h>\n #include <rte_errno.h>\n #include <rte_cycles.h>\n+#include <rte_compat.h>\n \n #include \"rte_eth_bond_private.h\"\n \n+static void bond_mode_8023ad_ext_periodic_cb(void *arg);\n+\n #ifdef RTE_LIBRTE_BOND_DEBUG_8023AD\n #define MODE4_DEBUG(fmt, ...) RTE_LOG(DEBUG, PMD, \"%6u [Port %u: %s] \" fmt, \\\n \t\t\tbond_dbg_get_time_diff_ms(), slave_id, \\\n@@ -1005,7 +1008,7 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev)\n \t\tbond_mode_8023ad_start(bond_dev);\n }\n \n-void\n+static void\n bond_mode_8023ad_conf_get(struct rte_eth_dev *dev,\n \t\tstruct rte_eth_bond_8023ad_conf *conf)\n {\n@@ -1023,26 +1026,36 @@ bond_mode_8023ad_conf_get(struct rte_eth_dev *dev,\n \tconf->rx_marker_period_ms = mode4->rx_marker_timeout / ms_ticks;\n }\n \n-void\n-bond_mode_8023ad_setup(struct rte_eth_dev *dev,\n+static void\n+bond_mode_8023ad_conf_get_v1607(struct rte_eth_dev *dev,\n \t\tstruct rte_eth_bond_8023ad_conf *conf)\n {\n-\tstruct rte_eth_bond_8023ad_conf def_conf;\n \tstruct bond_dev_private *internals = dev->data->dev_private;\n \tstruct mode8023ad_private *mode4 = &internals->mode4;\n-\tuint64_t ms_ticks = rte_get_tsc_hz() / 1000;\n \n-\tif (conf == NULL) {\n-\t\tconf = &def_conf;\n-\t\tconf->fast_periodic_ms = BOND_8023AD_FAST_PERIODIC_MS;\n-\t\tconf->slow_periodic_ms = BOND_8023AD_SLOW_PERIODIC_MS;\n-\t\tconf->short_timeout_ms = BOND_8023AD_SHORT_TIMEOUT_MS;\n-\t\tconf->long_timeout_ms = BOND_8023AD_LONG_TIMEOUT_MS;\n-\t\tconf->aggregate_wait_timeout_ms = BOND_8023AD_AGGREGATE_WAIT_TIMEOUT_MS;\n-\t\tconf->tx_period_ms = BOND_8023AD_TX_MACHINE_PERIOD_MS;\n-\t\tconf->rx_marker_period_ms = BOND_8023AD_RX_MARKER_PERIOD_MS;\n-\t\tconf->update_timeout_ms = BOND_MODE_8023AX_UPDATE_TIMEOUT_MS;\n-\t}\n+\tbond_mode_8023ad_conf_get(dev, conf);\n+\tconf->slowrx_cb = mode4->slowrx_cb;\n+}\n+\n+static void\n+bond_mode_8023ad_conf_get_default(struct rte_eth_bond_8023ad_conf *conf)\n+{\n+\tconf->fast_periodic_ms = BOND_8023AD_FAST_PERIODIC_MS;\n+\tconf->slow_periodic_ms = BOND_8023AD_SLOW_PERIODIC_MS;\n+\tconf->short_timeout_ms = BOND_8023AD_SHORT_TIMEOUT_MS;\n+\tconf->long_timeout_ms = BOND_8023AD_LONG_TIMEOUT_MS;\n+\tconf->aggregate_wait_timeout_ms = BOND_8023AD_AGGREGATE_WAIT_TIMEOUT_MS;\n+\tconf->tx_period_ms = BOND_8023AD_TX_MACHINE_PERIOD_MS;\n+\tconf->rx_marker_period_ms = BOND_8023AD_RX_MARKER_PERIOD_MS;\n+\tconf->update_timeout_ms = BOND_MODE_8023AX_UPDATE_TIMEOUT_MS;\n+\tconf->slowrx_cb = NULL;\n+}\n+\n+static void\n+bond_mode_8023ad_conf_assign(struct mode8023ad_private *mode4,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf)\n+{\n+\tuint64_t ms_ticks = rte_get_tsc_hz() / 1000;\n \n \tmode4->fast_periodic_timeout = conf->fast_periodic_ms * ms_ticks;\n \tmode4->slow_periodic_timeout = conf->slow_periodic_ms * ms_ticks;\n@@ -1054,6 +1067,48 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev,\n \tmode4->update_timeout_us = conf->update_timeout_ms * 1000;\n }\n \n+static void\n+bond_mode_8023ad_setup_v1604(struct rte_eth_dev *dev,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf)\n+{\n+\tstruct rte_eth_bond_8023ad_conf def_conf;\n+\tstruct bond_dev_private *internals = dev->data->dev_private;\n+\tstruct mode8023ad_private *mode4 = &internals->mode4;\n+\n+\tif (conf == NULL) {\n+\t\tconf = &def_conf;\n+\t\tbond_mode_8023ad_conf_get_default(conf);\n+\t}\n+\n+\tbond_mode_8023ad_stop(dev);\n+\tbond_mode_8023ad_conf_assign(mode4, conf);\n+\n+\tif (dev->data->dev_started)\n+\t\tbond_mode_8023ad_start(dev);\n+}\n+\n+\n+void\n+bond_mode_8023ad_setup(struct rte_eth_dev *dev,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf)\n+{\n+\tstruct rte_eth_bond_8023ad_conf def_conf;\n+\tstruct bond_dev_private *internals = dev->data->dev_private;\n+\tstruct mode8023ad_private *mode4 = &internals->mode4;\n+\n+\tif (conf == NULL) {\n+\t\tconf = &def_conf;\n+\t\tbond_mode_8023ad_conf_get_default(conf);\n+\t}\n+\n+\tbond_mode_8023ad_stop(dev);\n+\tbond_mode_8023ad_conf_assign(mode4, conf);\n+\tmode4->slowrx_cb = conf->slowrx_cb;\n+\n+\tif (dev->data->dev_started)\n+\t\tbond_mode_8023ad_start(dev);\n+}\n+\n int\n bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev)\n {\n@@ -1069,13 +1124,28 @@ bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev)\n int\n bond_mode_8023ad_start(struct rte_eth_dev *bond_dev)\n {\n-\treturn rte_eal_alarm_set(BOND_MODE_8023AX_UPDATE_TIMEOUT_MS * 1000,\n-\t\t\t&bond_mode_8023ad_periodic_cb, bond_dev);\n+\tstruct bond_dev_private *internals = bond_dev->data->dev_private;\n+\tstruct mode8023ad_private *mode4 = &internals->mode4;\n+\tstatic const uint64_t us = BOND_MODE_8023AX_UPDATE_TIMEOUT_MS * 1000;\n+\n+\tif (mode4->slowrx_cb)\n+\t\treturn rte_eal_alarm_set(us, &bond_mode_8023ad_ext_periodic_cb,\n+\t\t\t\t\t bond_dev);\n+\n+\treturn rte_eal_alarm_set(us, &bond_mode_8023ad_periodic_cb, bond_dev);\n }\n \n void\n bond_mode_8023ad_stop(struct rte_eth_dev *bond_dev)\n {\n+\tstruct bond_dev_private *internals = bond_dev->data->dev_private;\n+\tstruct mode8023ad_private *mode4 = &internals->mode4;\n+\n+\tif (mode4->slowrx_cb) {\n+\t\trte_eal_alarm_cancel(&bond_mode_8023ad_ext_periodic_cb,\n+\t\t\t\t     bond_dev);\n+\t\treturn;\n+\t}\n \trte_eal_alarm_cancel(&bond_mode_8023ad_periodic_cb, bond_dev);\n }\n \n@@ -1144,7 +1214,7 @@ free_out:\n }\n \n int\n-rte_eth_bond_8023ad_conf_get(uint8_t port_id,\n+rte_eth_bond_8023ad_conf_get_v1604(uint8_t port_id,\n \t\tstruct rte_eth_bond_8023ad_conf *conf)\n {\n \tstruct rte_eth_dev *bond_dev;\n@@ -1159,9 +1229,10 @@ rte_eth_bond_8023ad_conf_get(uint8_t port_id,\n \tbond_mode_8023ad_conf_get(bond_dev, conf);\n \treturn 0;\n }\n+VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1604, 16.04);\n \n int\n-rte_eth_bond_8023ad_setup(uint8_t port_id,\n+rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id,\n \t\tstruct rte_eth_bond_8023ad_conf *conf)\n {\n \tstruct rte_eth_dev *bond_dev;\n@@ -1169,6 +1240,25 @@ rte_eth_bond_8023ad_setup(uint8_t port_id,\n \tif (valid_bonded_port_id(port_id) != 0)\n \t\treturn -EINVAL;\n \n+\tif (conf == NULL)\n+\t\treturn -EINVAL;\n+\n+\tbond_dev = &rte_eth_devices[port_id];\n+\tbond_mode_8023ad_conf_get_v1607(bond_dev, conf);\n+\treturn 0;\n+}\n+BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1607, 16.07);\n+MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_conf_get(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf),\n+\t\trte_eth_bond_8023ad_conf_get_v1607);\n+\n+static int\n+bond_8023ad_setup_validate(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf)\n+{\n+\tif (valid_bonded_port_id(port_id) != 0)\n+\t\treturn -EINVAL;\n+\n \tif (conf != NULL) {\n \t\t/* Basic sanity check */\n \t\tif (conf->slow_periodic_ms == 0 ||\n@@ -1184,11 +1274,47 @@ rte_eth_bond_8023ad_setup(uint8_t port_id,\n \t\t}\n \t}\n \n+\treturn 0;\n+}\n+\n+int\n+rte_eth_bond_8023ad_setup_v1604(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf)\n+{\n+\tstruct rte_eth_dev *bond_dev;\n+\tint err;\n+\n+\terr = bond_8023ad_setup_validate(port_id, conf);\n+\tif (err != 0)\n+\t\treturn err;\n+\n+\tbond_dev = &rte_eth_devices[port_id];\n+\tbond_mode_8023ad_setup_v1604(bond_dev, conf);\n+\n+\treturn 0;\n+}\n+VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v1604, 16.04);\n+\n+int\n+rte_eth_bond_8023ad_setup_v1607(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf)\n+{\n+\tstruct rte_eth_dev *bond_dev;\n+\tint err;\n+\n+\terr = bond_8023ad_setup_validate(port_id, conf);\n+\tif (err != 0)\n+\t\treturn err;\n+\n \tbond_dev = &rte_eth_devices[port_id];\n \tbond_mode_8023ad_setup(bond_dev, conf);\n \n \treturn 0;\n }\n+BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1607, 16.07);\n+MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf),\n+\t\trte_eth_bond_8023ad_setup_v1607);\n \n int\n rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id,\n@@ -1222,3 +1348,160 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id,\n \tinfo->agg_port_id = port->aggregator_port_id;\n \treturn 0;\n }\n+\n+static int\n+bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id)\n+{\n+\tstruct rte_eth_dev *bond_dev;\n+\tstruct bond_dev_private *internals;\n+\tstruct mode8023ad_private *mode4;\n+\n+\tif (rte_eth_bond_mode_get(port_id) != BONDING_MODE_8023AD)\n+\t\treturn -EINVAL;\n+\n+\tbond_dev = &rte_eth_devices[port_id];\n+\n+\tif (!bond_dev->data->dev_started)\n+\t\treturn -EINVAL;\n+\n+\tinternals = bond_dev->data->dev_private;\n+\tif (find_slave_by_id(internals->active_slaves,\n+\t\t\tinternals->active_slave_count, slave_id) ==\n+\t\t\t\tinternals->active_slave_count)\n+\t\treturn -EINVAL;\n+\n+\tmode4 = &internals->mode4;\n+\tif (mode4->slowrx_cb == NULL)\n+\t\treturn -EINVAL;\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled)\n+{\n+\tstruct port *port;\n+\tint res;\n+\n+\tres = bond_8023ad_ext_validate(port_id, slave_id);\n+\tif (res != 0)\n+\t\treturn res;\n+\n+\tport = &mode_8023ad_ports[slave_id];\n+\n+\tif (enabled)\n+\t\tACTOR_STATE_SET(port, COLLECTING);\n+\telse\n+\t\tACTOR_STATE_CLR(port, COLLECTING);\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled)\n+{\n+\tstruct port *port;\n+\tint res;\n+\n+\tres = bond_8023ad_ext_validate(port_id, slave_id);\n+\tif (res != 0)\n+\t\treturn res;\n+\n+\tport = &mode_8023ad_ports[slave_id];\n+\n+\tif (enabled)\n+\t\tACTOR_STATE_SET(port, DISTRIBUTING);\n+\telse\n+\t\tACTOR_STATE_CLR(port, DISTRIBUTING);\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id)\n+{\n+\tstruct port *port;\n+\tint err;\n+\n+\terr = bond_8023ad_ext_validate(port_id, slave_id);\n+\tif (err != 0)\n+\t\treturn err;\n+\n+\tport = &mode_8023ad_ports[slave_id];\n+\treturn ACTOR_STATE(port, DISTRIBUTING);\n+}\n+\n+int\n+rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id)\n+{\n+\tstruct port *port;\n+\tint err;\n+\n+\terr = bond_8023ad_ext_validate(port_id, slave_id);\n+\tif (err != 0)\n+\t\treturn err;\n+\n+\tport = &mode_8023ad_ports[slave_id];\n+\treturn ACTOR_STATE(port, COLLECTING);\n+}\n+\n+int\n+rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id,\n+\t\tstruct rte_mbuf *lacp_pkt)\n+{\n+\tstruct port *port;\n+\tint res;\n+\n+\tres = bond_8023ad_ext_validate(port_id, slave_id);\n+\tif (res != 0)\n+\t\treturn res;\n+\n+\tport = &mode_8023ad_ports[slave_id];\n+\n+\tif (rte_pktmbuf_pkt_len(lacp_pkt) < sizeof(struct lacpdu_header))\n+\t\treturn -EINVAL;\n+\n+\tstruct lacpdu_header *lacp;\n+\n+\t/* only enqueue LACPDUs */\n+\tlacp = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *);\n+\tif (lacp->lacpdu.subtype != SLOW_SUBTYPE_LACP)\n+\t\treturn -EINVAL;\n+\n+\tMODE4_DEBUG(\"sending LACP frame\\n\");\n+\n+\treturn rte_ring_enqueue(port->tx_ring, lacp_pkt);\n+}\n+\n+static void\n+bond_mode_8023ad_ext_periodic_cb(void *arg)\n+{\n+\tstruct rte_eth_dev *bond_dev = arg;\n+\tstruct bond_dev_private *internals = bond_dev->data->dev_private;\n+\tstruct mode8023ad_private *mode4 = &internals->mode4;\n+\tstruct port *port;\n+\tvoid *pkt = NULL;\n+\tuint16_t i, slave_id;\n+\n+\tfor (i = 0; i < internals->active_slave_count; i++) {\n+\t\tslave_id = internals->active_slaves[i];\n+\t\tport = &mode_8023ad_ports[slave_id];\n+\n+\t\tif (rte_ring_dequeue(port->rx_ring, &pkt) == 0) {\n+\t\t\tstruct rte_mbuf *lacp_pkt = pkt;\n+\t\t\tstruct lacpdu_header *lacp;\n+\n+\t\t\tlacp = rte_pktmbuf_mtod(lacp_pkt,\n+\t\t\t\t\t\tstruct lacpdu_header *);\n+\t\t\tRTE_VERIFY(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP);\n+\n+\t\t\t/* This is LACP frame so pass it to rx callback.\n+\t\t\t * Callback is responsible for freeing mbuf.\n+\t\t\t */\n+\t\t\tmode4->slowrx_cb(slave_id, lacp_pkt);\n+\t\t}\n+\t}\n+\n+\trte_eal_alarm_set(internals->mode4.update_timeout_us,\n+\t\t\tbond_mode_8023ad_ext_periodic_cb, arg);\n+}\ndiff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h\nindex ebd0e93..1de34bc 100644\n--- a/drivers/net/bonding/rte_eth_bond_8023ad.h\n+++ b/drivers/net/bonding/rte_eth_bond_8023ad.h\n@@ -64,6 +64,9 @@ extern \"C\" {\n #define MARKER_TLV_TYPE_INFO                0x01\n #define MARKER_TLV_TYPE_RESP                0x02\n \n+typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint8_t slave_id,\n+\t\t\t\t\t\t  struct rte_mbuf *lacp_pkt);\n+\n enum rte_bond_8023ad_selection {\n \tUNSELECTED,\n \tSTANDBY,\n@@ -157,6 +160,7 @@ struct rte_eth_bond_8023ad_conf {\n \tuint32_t tx_period_ms;\n \tuint32_t rx_marker_period_ms;\n \tuint32_t update_timeout_ms;\n+\trte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;\n };\n \n struct rte_eth_bond_8023ad_slave_info {\n@@ -183,6 +187,12 @@ struct rte_eth_bond_8023ad_slave_info {\n int\n rte_eth_bond_8023ad_conf_get(uint8_t port_id,\n \t\tstruct rte_eth_bond_8023ad_conf *conf);\n+int\n+rte_eth_bond_8023ad_conf_get_v1604(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf);\n+int\n+rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf);\n \n /**\n  * @internal\n@@ -198,6 +208,12 @@ rte_eth_bond_8023ad_conf_get(uint8_t port_id,\n int\n rte_eth_bond_8023ad_setup(uint8_t port_id,\n \t\tstruct rte_eth_bond_8023ad_conf *conf);\n+int\n+rte_eth_bond_8023ad_setup_v1604(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf);\n+int\n+rte_eth_bond_8023ad_setup_v1607(uint8_t port_id,\n+\t\tstruct rte_eth_bond_8023ad_conf *conf);\n \n /**\n  * @internal\n@@ -219,4 +235,71 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id,\n }\n #endif\n \n+/**\n+ * Configure a slave port to start collecting.\n+ *\n+ * @param port_id\tBonding device id\n+ * @param slave_id\tPort id of valid slave.\n+ * @param enabled\tNon-zero when collection enabled.\n+ * @return\n+ *   0 - if ok\n+ *   -EINVAL if slave is not valid.\n+ */\n+int\n+rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled);\n+\n+/**\n+ * Get COLLECTING flag from slave port actor state.\n+ *\n+ * @param port_id\tBonding device id\n+ * @param slave_id\tPort id of valid slave.\n+ * @return\n+ *   0 - if not set\n+ *   1 - if set\n+ *   -EINVAL if slave is not valid.\n+ */\n+int\n+rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id);\n+\n+/**\n+ * Configure a slave port to start distributing.\n+ *\n+ * @param port_id\tBonding device id\n+ * @param slave_id\tPort id of valid slave.\n+ * @param enabled\tNon-zero when distribution enabled.\n+ * @return\n+ *   0 - if ok\n+ *   -EINVAL if slave is not valid.\n+ */\n+int\n+rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled);\n+\n+/**\n+ * Get DISTRIBUTING flag from slave port actor state.\n+ *\n+ * @param port_id\tBonding device id\n+ * @param slave_id\tPort id of valid slave.\n+ * @return\n+ *   0 - if not set\n+ *   1 - if set\n+ *   -EINVAL if slave is not valid.\n+ */\n+int\n+rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id);\n+\n+/**\n+ * LACPDU transmit path for external 802.3ad state machine.  Caller retains\n+ * ownership of the packet on failure.\n+ *\n+ * @param port_id\tBonding device id\n+ * @param slave_id\tPort ID of valid slave device.\n+ * @param lacp_pkt\tmbuf containing LACPDU.\n+ *\n+ * @return\n+ *   0 on success, negative value otherwise.\n+ */\n+int\n+rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id,\n+\t\tstruct rte_mbuf *lacp_pkt);\n+\n #endif /* RTE_ETH_BOND_8023AD_H_ */\ndiff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h\nindex 8adee70..ca8858b 100644\n--- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h\n+++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h\n@@ -173,6 +173,8 @@ struct mode8023ad_private {\n \tuint64_t tx_period_timeout;\n \tuint64_t rx_marker_timeout;\n \tuint64_t update_timeout_us;\n+\trte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;\n+\tuint8_t external_sm;\n };\n \n /**\n@@ -185,18 +187,6 @@ extern struct port mode_8023ad_ports[];\n /* Forward declaration */\n struct bond_dev_private;\n \n-/**\n- * @internal\n- *\n- * Get configuration of bonded interface.\n- *\n- *\n- * @param dev Bonded interface\n- * @param conf returned configuration\n- */\n-void\n-bond_mode_8023ad_conf_get(struct rte_eth_dev *dev,\n-\t\tstruct rte_eth_bond_8023ad_conf *conf);\n \n /**\n  * @internal\ndiff --git a/drivers/net/bonding/rte_eth_bond_version.map b/drivers/net/bonding/rte_eth_bond_version.map\nindex 22bd920..2de0a7d 100644\n--- a/drivers/net/bonding/rte_eth_bond_version.map\n+++ b/drivers/net/bonding/rte_eth_bond_version.map\n@@ -27,3 +27,19 @@ DPDK_2.1 {\n \trte_eth_bond_free;\n \n } DPDK_2.0;\n+\n+DPDK_16.04 {\n+};\n+\n+DPDK_16.07 {\n+\tglobal:\n+\n+\trte_eth_bond_8023ad_ext_collect;\n+\trte_eth_bond_8023ad_ext_collect_get;\n+\trte_eth_bond_8023ad_ext_distrib;\n+\trte_eth_bond_8023ad_ext_distrib_get;\n+\trte_eth_bond_8023ad_ext_slowtx;\n+\trte_eth_bond_8023ad_conf_get;\n+\trte_eth_bond_8023ad_setup;\n+\n+} DPDK_16.04;\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "1/2"
    ]
}