Show a patch.

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

{
    "id": 218,
    "url": "https://patches.dpdk.org/api/patches/218/?format=api",
    "web_url": "https://patches.dpdk.org/patch/218/",
    "project": {
        "id": 1,
        "url": "https://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"
    },
    "msgid": "<20140826020858.448904783@networkplumber.org>",
    "date": "2014-08-26T02:07:56",
    "name": "[dpdk-dev,RFC,10/10] virtio: add support for promiscious and multicast",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "c555b9210f3fbc2225f051ef32acf6662530c470",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/218/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/218/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/218/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "Return-Path": "<stephen@networkplumber.org>",
        "To": "Ouyang Changchun <changchun.ouyang@intel.com>",
        "Message-Id": "<20140826020858.448904783@networkplumber.org>",
        "X-Gm-Message-State": "ALoCoQlurl6YW7DvHRYx6B7k1Ynq9XkiUoYiDpoGlPzgyfyhGiX9MTl5OHBX7BA4HfeJbk7kAiaX",
        "User-Agent": "quilt/0.63-1",
        "Cc": "dev@dpdk.org, Stephen Hemminger <shemming@brocade.com>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from mail-pa0-f53.google.com (mail-pa0-f53.google.com\n\t[209.85.220.53]) by dpdk.org (Postfix) with ESMTP id 393CAB39D\n\tfor <dev@dpdk.org>; Tue, 26 Aug 2014 04:05:03 +0200 (CEST)",
            "by mail-pa0-f53.google.com with SMTP id rd3so22402548pab.12\n\tfor <dev@dpdk.org>; Mon, 25 Aug 2014 19:09:00 -0700 (PDT)",
            "from localhost (static-50-53-65-80.bvtn.or.frontiernet.net.\n\t[50.53.65.80]) by mx.google.com with ESMTPSA id\n\tdl8sm1944682pdb.65.2014.08.25.19.08.59 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 25 Aug 2014 19:08:59 -0700 (PDT)"
        ],
        "Subject": "[dpdk-dev] [RFC 10/10] virtio: add support for promiscious and\n\tmulticast",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Date": "Mon, 25 Aug 2014 19:07:56 -0700",
        "Precedence": "list",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "X-Received": "by 10.68.57.165 with SMTP id j5mr15663915pbq.147.1409018940378; \n\tMon, 25 Aug 2014 19:09:00 -0700 (PDT)",
        "MIME-Version": "1.0",
        "References": "<20140826020746.062748014@networkplumber.org>",
        "Content-Disposition": "inline; filename=virtio-ctrl-rx.patch",
        "X-List-Received-Date": "Tue, 26 Aug 2014 02:05:03 -0000",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Content-Type": "text/plain; charset=UTF-8",
        "X-Mailman-Version": "2.1.15",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:message-id:user-agent:date:from:to:cc:subject\n\t:references:mime-version:content-type:content-disposition;\n\tbh=8wIE+iq/o0ncGLSQAcPeMI4D6fw0FOGOe8iCErEsDLU=;\n\tb=IstkTteNyJwsrWVP7Ivk50pD1pKoLkvhdkyQkOknOwQ1ruBGre06IvwOUJSwsiQOfR\n\tblawrtkCsCTuG2OGvPve4w1AKWsuJVlv2EBS13q9rWyF5Bcx64GjY6JPnIyuY/U6cpRc\n\ty9Z7xXlWkoxTBcPqSZFkjjgBTu5ZTdPSijxS9RMY7BSZIIwOkrcZk6tXiuSrFuBDKuZo\n\tS2WNKlXZB/hvI4YcGRfsstzyFJ5WtzMMcotmkpaq0wiHBEYPCepeRfNo74fJvjRuosWp\n\tuCLuqKaVqquxK2ZS+WYeFAgNUXgsdWJysmJ2pFCBi2rb15EW9Et5+9nkS+eszIl/aTvY\n\tMrxA==",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>"
    },
    "content": "Implement standard virtio controls for enabling and disabling\npromiscious and multicast.\n\nSigned-off-by: Stephen Hemminger <shemming@brocade.com>",
    "diff": "--- a/lib/librte_pmd_virtio/virtio_ethdev.c\t2014-08-25 19:00:16.754586819 -0700\n+++ b/lib/librte_pmd_virtio/virtio_ethdev.c\t2014-08-25 19:02:48.019397658 -0700\n@@ -77,6 +77,11 @@ static void virtio_get_hwaddr(struct vir\n static void virtio_dev_rx_queue_release(__rte_unused void *rxq);\n static void virtio_dev_tx_queue_release(__rte_unused void *txq);\n \n+static void virtio_promiscuous_enable(struct rte_eth_dev *dev);\n+static void virtio_promiscuous_disable(struct rte_eth_dev *dev);\n+static void virtio_allmulticast_enable(struct rte_eth_dev *dev);\n+static void virtio_allmulticast_disable(struct rte_eth_dev *dev);\n+\n static void virtio_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats);\n static void virtio_dev_stats_reset(struct rte_eth_dev *dev);\n static void virtio_dev_free_mbufs(struct rte_eth_dev *dev);\n@@ -405,23 +410,27 @@ virtio_dev_close(struct rte_eth_dev *dev\n  * dev_ops for virtio, bare necessities for basic operation\n  */\n static struct eth_dev_ops virtio_eth_dev_ops = {\n-\t.dev_configure           = virtio_dev_configure,\n-\t.dev_start               = virtio_dev_start,\n-\t.dev_stop                = virtio_dev_stop,\n-\t.dev_close               = virtio_dev_close,\n-\n-\t.dev_infos_get           = virtio_dev_info_get,\n-\t.stats_get               = virtio_dev_stats_get,\n-\t.stats_reset             = virtio_dev_stats_reset,\n-\t.link_update             = virtio_dev_link_update,\n-\t.mac_addr_add            = NULL,\n-\t.mac_addr_remove         = NULL,\n-\t.rx_queue_setup          = virtio_dev_rx_queue_setup,\n+\t.dev_configure\t\t = virtio_dev_configure,\n+\t.dev_start\t\t = virtio_dev_start,\n+\t.dev_stop\t\t = virtio_dev_stop,\n+\t.dev_close\t\t = virtio_dev_close,\n+\n+\t.dev_infos_get\t\t = virtio_dev_info_get,\n+\t.stats_get\t\t = virtio_dev_stats_get,\n+\t.stats_reset\t\t = virtio_dev_stats_reset,\n+\t.link_update\t\t = virtio_dev_link_update,\n+\t.promiscuous_enable\t = virtio_promiscuous_enable,\n+\t.promiscuous_disable\t = virtio_promiscuous_disable,\n+\t.allmulticast_enable\t = virtio_allmulticast_enable,\n+\t.allmulticast_disable\t = virtio_allmulticast_disable,\n+\t.mac_addr_add\t\t = NULL,\n+\t.mac_addr_remove\t = NULL,\n+\t.rx_queue_setup\t\t = virtio_dev_rx_queue_setup,\n \t/* meaningfull only to multiple queue */\n-\t.rx_queue_release        = virtio_dev_rx_queue_release,\n-\t.tx_queue_setup          = virtio_dev_tx_queue_setup,\n+\t.rx_queue_release\t = virtio_dev_rx_queue_release,\n+\t.tx_queue_setup\t\t = virtio_dev_tx_queue_setup,\n \t/* meaningfull only to multiple queue */\n-\t.tx_queue_release        = virtio_dev_tx_queue_release,\n+\t.tx_queue_release\t = virtio_dev_tx_queue_release,\n \t/* collect stats per queue */\n \t.queue_stats_mapping_set = virtio_dev_queue_stats_mapping_set,\n };\n@@ -466,6 +475,63 @@ virtio_dev_atomic_write_link_status(stru\n \treturn 0;\n }\n \n+/* Control receive processing (ie multicast, promiscious, mac address). */\n+static int virtio_ctrl_rx(struct virtio_hw *hw, uint8_t cmd, uint8_t onoff)\n+{\n+\tstruct virtio_pmd_ctrl ctrl;\n+\tint len, ret;\n+\n+\tif (!vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_RX))\n+\t\treturn -ENOTSUP;\n+\n+\tctrl.hdr.class = VIRTIO_NET_CTRL_RX;\n+\tctrl.hdr.cmd = cmd;\n+\tmemcpy(ctrl.data, &onoff, sizeof(uint8_t));\n+\n+\tlen = sizeof(uint8_t);\n+\tret = virtio_send_command(hw->cvq, &ctrl, &len, 1);\n+\tif (ret != 0)\n+\t\tPMD_DRV_LOG(NOTICE, \"ctrl_rx %u failed: %d\\n\", cmd, ret);\n+\n+\treturn ret;\n+}\n+\n+static void\n+virtio_promiscuous_enable(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n+\n+\tPMD_INIT_LOG(DEBUG, \"promiscious enable\");\n+\tvirtio_ctrl_rx(hw, VIRTIO_NET_CTRL_RX_PROMISC, 1);\n+}\n+\n+static void\n+virtio_promiscuous_disable(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n+\n+\tPMD_INIT_LOG(DEBUG, \"promiscious disable\");\n+\tvirtio_ctrl_rx(hw, VIRTIO_NET_CTRL_RX_PROMISC, 0);\n+}\n+\n+static void\n+virtio_allmulticast_enable(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n+\n+\tPMD_INIT_LOG(DEBUG, \"allmulticast enable\");\n+\tvirtio_ctrl_rx(hw, VIRTIO_NET_CTRL_RX_ALLMULTI, 1);\n+}\n+\n+static void\n+virtio_allmulticast_disable(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n+\n+\tPMD_INIT_LOG(DEBUG, \"allmulticast disable\");\n+\tvirtio_ctrl_rx(hw, VIRTIO_NET_CTRL_RX_ALLMULTI, 0);\n+}\n+\n static void\n virtio_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n {\n@@ -559,7 +625,7 @@ virtio_negotiate_features(struct virtio_\n {\n \tuint32_t host_features, mask;\n \n-\tmask = VIRTIO_NET_F_CTRL_RX | VIRTIO_NET_F_CTRL_VLAN;\n+\tmask = VIRTIO_NET_F_CTRL_VLAN;\n \tmask |= VIRTIO_NET_F_CSUM | VIRTIO_NET_F_GUEST_CSUM;\n \n \t/* TSO and LRO are only available when their corresponding\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "10/10"
    ]
}