Show a patch.

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

{
    "id": 214,
    "url": "http://patches.dpdk.org/api/patches/214/",
    "web_url": "http://patches.dpdk.org/patch/214/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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": "<20140826020848.386074683@networkplumber.org>",
    "date": "2014-08-26T02:07:52",
    "name": "[dpdk-dev,RFC,06/10] virtio: use software vlan stripping",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "45da10344aa54b1b2d4a46decd5f3ecbad77d0ba",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/214/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/214/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/214/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<stephen@networkplumber.org>",
        "References": "<20140826020746.062748014@networkplumber.org>",
        "X-Mailman-Version": "2.1.15",
        "Date": "Mon, 25 Aug 2014 19:07:52 -0700",
        "X-List-Received-Date": "Tue, 26 Aug 2014 02:04:55 -0000",
        "User-Agent": "quilt/0.63-1",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Content-Type": "text/plain; charset=UTF-8",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<20140826020848.386074683@networkplumber.org>",
        "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=xzBwBw2nnpClwbt7Dndma1vn3EYoYFfFLtK59LqcF1U=;\n\tb=CopndA5KfhKkDavmw8L2oGKVnzp2M+1/6biXry808vhMDvJgnjcVCjxxxkAp4V2J5T\n\tY59mK59A6UIM/zVI/Bv7zfOzNVa20PMpud2GvRIb8odF4OrmG8UnAEdcVODMfWSh9RB6\n\t+ERwsxIsI9Qy/aZpTxdAydm/DO6OUuMN3IrKfsDy2RouNo8s+epiNQBtM5BJZzuvCu7D\n\tiqxs4FknyE58JRb9f1pLqOl9KRgjl8fOf8rHSzQOJHdF84xQLcre/Dz6Udf0tLBzH3wS\n\tTWtYIXeHRhPcoWyqrs+dTK1sElKtwoqmyTg0u++wlFdlLFHZddHSsumJRJqJ59ANJ2QB\n\tzTQw==",
        "Received": [
            "from mail-pd0-f175.google.com (mail-pd0-f175.google.com\n\t[209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 5742C6A98\n\tfor <dev@dpdk.org>; Tue, 26 Aug 2014 04:04:54 +0200 (CEST)",
            "by mail-pd0-f175.google.com with SMTP id r10so21550610pdi.34\n\tfor <dev@dpdk.org>; Mon, 25 Aug 2014 19:08:51 -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\tbq17sm4462556pac.47.2014.08.25.19.08.49 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 25 Aug 2014 19:08:49 -0700 (PDT)"
        ],
        "Subject": "[dpdk-dev] [RFC 06/10] virtio: use software vlan stripping",
        "X-Received": "by 10.66.157.40 with SMTP id wj8mr33314863pab.42.1409018931426; \n\tMon, 25 Aug 2014 19:08:51 -0700 (PDT)",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Precedence": "list",
        "X-Gm-Message-State": "ALoCoQmiT7c3NkpgnL6tckjJtbUM/auM0hCtCQWVa73ORofEhiMoUUOtu0kCekBg3nrVKxcADJ7I",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Cc": "dev@dpdk.org",
        "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>",
        "MIME-Version": "1.0",
        "To": "Ouyang Changchun <changchun.ouyang@intel.com>",
        "Content-Disposition": "inline; filename=virtio-vlan-tag.patch"
    },
    "content": "Implement VLAN stripping in software. This allows application\nto be device independent.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n\n\n---\n lib/librte_pmd_virtio/virtio_ethdev.c |    2 ++\n lib/librte_pmd_virtio/virtio_pci.h    |    1 +\n lib/librte_pmd_virtio/virtio_rxtx.c   |   20 ++++++++++++++++++--\n 3 files changed, 21 insertions(+), 2 deletions(-)",
    "diff": "--- a/lib/librte_pmd_virtio/virtio_ethdev.c\t2014-08-25 19:00:07.574537243 -0700\n+++ b/lib/librte_pmd_virtio/virtio_ethdev.c\t2014-08-25 19:00:07.574537243 -0700\n@@ -976,6 +976,8 @@ virtio_dev_configure(struct rte_eth_dev\n \t\treturn (-EINVAL);\n \t}\n \n+\thw->vlan_strip = rxmode->hw_vlan_strip;\n+\n \tret = vtpci_irq_config(hw, 0);\n \tif (ret != 0)\n \t\tPMD_DRV_LOG(ERR, \"failed to set config vector\");\n--- a/lib/librte_pmd_virtio/virtio_pci.h\t2014-08-25 19:00:07.574537243 -0700\n+++ b/lib/librte_pmd_virtio/virtio_pci.h\t2014-08-25 19:00:07.574537243 -0700\n@@ -168,6 +168,7 @@ struct virtio_hw {\n \tuint32_t    max_tx_queues;\n \tuint32_t    max_rx_queues;\n \tuint16_t    vtnet_hdr_size;\n+\tuint8_t\t    vlan_strip;\n \tuint8_t\t    use_msix;\n \tuint8_t     mac_addr[ETHER_ADDR_LEN];\n };\n--- a/lib/librte_pmd_virtio/virtio_rxtx.c\t2014-08-25 19:00:07.574537243 -0700\n+++ b/lib/librte_pmd_virtio/virtio_rxtx.c\t2014-08-25 19:00:07.574537243 -0700\n@@ -49,6 +49,7 @@\n #include <rte_prefetch.h>\n #include <rte_string_fns.h>\n #include <rte_errno.h>\n+#include <rte_byteorder.h>\n \n #include \"virtio_logs.h\"\n #include \"virtio_ethdev.h\"\n@@ -406,8 +407,8 @@ virtio_dev_tx_queue_setup(struct rte_eth\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\tif ((tx_conf->txq_flags & ETH_TXQ_FLAGS_NOOFFLOADS)\n-\t    != ETH_TXQ_FLAGS_NOOFFLOADS) {\n+\tif ((tx_conf->txq_flags & ETH_TXQ_FLAGS_NOXSUMS)\n+\t    != ETH_TXQ_FLAGS_NOXSUMS) {\n \t\tPMD_INIT_LOG(ERR, \"TX checksum offload not supported\\n\");\n \t\treturn -EINVAL;\n \t}\n@@ -444,6 +445,7 @@ uint16_t\n virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n {\n \tstruct virtqueue *rxvq = rx_queue;\n+\tstruct virtio_hw *hw = rxvq->hw;\n \tstruct rte_mbuf *rxm, *new_mbuf;\n \tuint16_t nb_used, num, nb_rx = 0;\n \tuint32_t len[VIRTIO_MBUF_BURST_SZ];\n@@ -487,6 +489,9 @@ virtio_recv_pkts(void *rx_queue, struct\n \t\trxm->pkt.pkt_len = (uint32_t)(len[i] - hdr_size);\n \t\trxm->pkt.data_len = (uint16_t)(len[i] - hdr_size);\n \n+\t\tif (hw->vlan_strip)\n+\t\t\trte_vlan_strip(rxm);\n+\n \t\tVIRTIO_DUMP_PACKET(rxm, rxm->pkt.data_len);\n \n \t\trx_pkts[nb_rx++] = rxm;\n@@ -711,6 +716,17 @@ virtio_xmit_pkts(void *tx_queue, struct\n \n \t\tif (tx_pkts[nb_tx]->pkt.nb_segs <= txvq->vq_free_cnt) {\n \t\t\ttxm = tx_pkts[nb_tx];\n+\n+\t\t\t/* Do VLAN tag insertion */\n+\t\t\tif (txm->ol_flags & PKT_TX_VLAN_PKT) {\n+\t\t\t\terror = rte_vlan_insert(txm);\n+\t\t\t\tif (unlikely(error)) {\n+\t\t\t\t\trte_pktmbuf_free(txm);\n+\t\t\t\t\t++nb_tx;\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t}\n+\n \t\t\t/* Enqueue Packet buffers */\n \t\t\terror = virtqueue_enqueue_xmit(txvq, txm);\n \t\t\tif (unlikely(error)) {\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "06/10"
    ]
}