get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 16389,
    "url": "https://patches.dpdk.org/api/patches/16389/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/CY1PR03MB150394E8F63E461EB744B74ADAC40@CY1PR03MB1503.namprd03.prod.outlook.com/",
    "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<CY1PR03MB150394E8F63E461EB744B74ADAC40@CY1PR03MB1503.namprd03.prod.outlook.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/CY1PR03MB150394E8F63E461EB744B74ADAC40@CY1PR03MB1503.namprd03.prod.outlook.com",
    "date": "2016-10-05T14:05:04",
    "name": "[dpdk-dev,v7] net/virtio: add set_mtu in virtio",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "e43d167b4e657c76580e33a801dc4c52570fdf33",
    "submitter": {
        "id": 546,
        "url": "https://patches.dpdk.org/api/people/546/?format=api",
        "name": "souvikdey33",
        "email": "sodey@sonusnet.com"
    },
    "delegate": {
        "id": 355,
        "url": "https://patches.dpdk.org/api/users/355/?format=api",
        "username": "yliu",
        "first_name": "Yuanhan",
        "last_name": "Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/CY1PR03MB150394E8F63E461EB744B74ADAC40@CY1PR03MB1503.namprd03.prod.outlook.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/16389/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/16389/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 B50C02B96;\n\tWed,  5 Oct 2016 16:05:07 +0200 (CEST)",
            "from NAM03-DM3-obe.outbound.protection.outlook.com\n\t(mail-dm3nam03on0067.outbound.protection.outlook.com [104.47.41.67])\n\tby dpdk.org (Postfix) with ESMTP id AE8A72B8B\n\tfor <dev@dpdk.org>; Wed,  5 Oct 2016 16:05:06 +0200 (CEST)",
            "from CY1PR03MB1503.namprd03.prod.outlook.com (10.163.17.21) by\n\tCY1PR03MB1502.namprd03.prod.outlook.com (10.163.17.20) with Microsoft\n\tSMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id\n\t15.1.649.16; Wed, 5 Oct 2016 14:05:05 +0000",
            "from CY1PR03MB1503.namprd03.prod.outlook.com ([10.163.17.21]) by\n\tCY1PR03MB1503.namprd03.prod.outlook.com ([10.163.17.21]) with mapi id\n\t15.01.0649.021; Wed, 5 Oct 2016 14:05:05 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=SonusNetworks.onmicrosoft.com; s=selector1-sonusnet-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=YEad9Wap8zHugrDrzg8FfOqVj2Tl6NBPRPFlTvNa+s8=;\n\tb=T3eNAMxxcwqRVzM7aI9UVtbSj7pDyk5Zvg2w821oy0vuyIKktNvDf4ZSsLPcCZZnUALnsq2hwlYEIf2xOApDC0P5tr2BZtlAWt77MJPtZcwR011eLLn2YanTSn6QkPKM2tnTKfCIE5+CKMTgXmnJbI77xodNVleV+5EB9csLaLY=",
        "From": "\"Dey, Souvik\" <sodey@sonusnet.com>",
        "To": "\"Kavanagh, Mark B\" <mark.b.kavanagh@intel.com>,\n\t\"yuanhan.liu@linux.intel.com\" <yuanhan.liu@linux.intel.com>,\n\t\"stephen@networkplumber.org\" <stephen@networkplumber.org>",
        "CC": "\"dev@dpdk.org\" <dev@dpdk.org>",
        "Thread-Topic": "[PATCH v7] net/virtio: add set_mtu in virtio",
        "Thread-Index": "AQHSGpCEO2JH49nnlEKHRbCquIGY6aCTpQrAgAVQiPCAAJaigIAAX2Lg",
        "Date": "Wed, 5 Oct 2016 14:05:04 +0000",
        "Message-ID": "<CY1PR03MB150394E8F63E461EB744B74ADAC40@CY1PR03MB1503.namprd03.prod.outlook.com>",
        "References": "<20160922135643.37636-1-sodey@sonusnet.com>\n\t<20160929203130.58712-1-sodey@sonusnet.com>\n\t<BN3PR03MB1494CD67AB36557559F2CCCADAC50@BN3PR03MB1494.namprd03.prod.outlook.com>\n\t<DC5AD7FA266D86499789B1BCAEC715F85C722FC4@irsmsx105.ger.corp.intel.com>",
        "In-Reply-To": "<DC5AD7FA266D86499789B1BCAEC715F85C722FC4@irsmsx105.ger.corp.intel.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=sodey@sonusnet.com; ",
        "x-originating-ip": "[208.45.178.4]",
        "x-ms-office365-filtering-correlation-id": "40b8be5d-b7a0-4a41-4d30-08d3ed289b79",
        "x-microsoft-exchange-diagnostics": "1; CY1PR03MB1502;\n\t6:qZp0v9T1z2EnWM38PzQRi22waKmmRyPoqUipspaYqUvHqVknqx8q/L3gKr16vRM/n1ktioXBKxsBny9CIVK06F/dRgsA0UOhomjqFoUPl6PJ0wOCAat8b0d+cj4rlPSyF80f9spYF4g/bLPxWey+zDeIUrBLYZtbwJxqKrqXXey7t4jAqGlW44BPRZiXUorrNkj7omI2mI9Fj/lR35gAcjjRUSe/2liQq2gAa19RSr80pE7xkXM+HTqBf4kn3vNvoY+OaAE7hS98DUD/oi84Eo+OI+AA+i9Qq00CBMEN9IAK2J32YNQW1AMFI8qe7v3D;\n\t5:4KtB1p6UKiDRj2JOJVvEi9I7DKpcyl9ocCbHaPIvMHigoJifTXpklDb9DKtIWT83HVj34NWpv4Tvv6eyrx5a6vbtc4WpdXAijmKIlRZFLFwC/D2xGSf6FHx8gA5o7qCTjBGhKVtwQxb9XyMPr0Q1RB+pjKzb/CQtK/2F0FPONlg=;\n\t24:Qymfcc9HZi1h+/Bp31qKJNIuatDbDKD0Kho0eu6uA7CxI+w7rSymCThhZrZJGyyjXiFzkIcO4TuLAj6jFvUsYsQbjjUsKBU0wpYQlPplSHU=;\n\t7:6jDeke5aQmmpdj2f6BWUtorGfyuqbaeyyD0lDCa/eWJEbCECBJc1I0xmvAFCdlvBmPusYEt9VHb08uTgcGv+Dk100/BGDGPbdxaGye4MoKncyvFYQIoGawFLW8825yKfMYW7Vvfi2fpbDEGEQ8oIxof17/Vaqnx2hkETqV0iQXWM49vj9iBAa39zRlS6T3kZC3r2b3/uMb7yDrcU8dY1nlwO6RG+umVRq1tWNvibXtrmRK4EqL2wPWwZsrvlJ0g9S6qLwhoNqwSuWG4CsBVlEezlzDiq/DppH/BRVPZwzSATn85glEiMAC4Cil3lkUP1DUXYwNw4bsv/2uttHfUtyA==",
        "x-microsoft-antispam": "UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1502;",
        "x-microsoft-antispam-prvs": "<CY1PR03MB1502F81E984A2AFB767D5883DAC40@CY1PR03MB1502.namprd03.prod.outlook.com>",
        "x-exchange-antispam-report-test": "UriScan:(158342451672863)(228905959029699); ",
        "x-exchange-antispam-report-cfa-test": "BCL:0; PCL:0;\n\tRULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);\n\tSRVR:CY1PR03MB1502; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1502; ",
        "x-forefront-prvs": "008663486A",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(6009001)(7916002)(377454003)(43544003)(189002)(53754006)(199003)(13464003)(7846002)(7736002)(5002640100001)(2501003)(122556002)(68736007)(2900100001)(19580405001)(9686002)(19580395003)(3846002)(4326007)(11100500001)(77096005)(2950100002)(93886004)(92566002)(87936001)(102836003)(6116002)(8936002)(2201001)(7696004)(3280700002)(81156014)(81166006)(54356999)(50986999)(10400500002)(76176999)(101416001)(76576001)(5001770100001)(3660700001)(5660300001)(74316002)(86362001)(189998001)(586003)(2906002)(99286002)(66066001)(8676002)(33656002)(105586002)(106356001)(305945005)(106116001)(97736004);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB1502;\n\tH:CY1PR03MB1503.namprd03.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ",
        "received-spf": "None (protection.outlook.com: sonusnet.com does not designate\n\tpermitted sender hosts)",
        "spamdiagnosticoutput": "1:99",
        "spamdiagnosticmetadata": "NSPM",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "sonusnet.com",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "05 Oct 2016 14:05:04.8872\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "29a671dc-ed7e-4a54-b1e5-8da1eb495dc3",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CY1PR03MB1502",
        "Subject": "Re: [dpdk-dev] [PATCH v7] net/virtio: add set_mtu in virtio",
        "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": "Yes Mark, I have modified the patch with the below comments.\n\ndrivers/net/virtio/virtio_ethdev.c | 17 +++++++++++++++++\n 1 file changed, 17 insertions(+)\n\nSent: Wednesday, October 5, 2016 4:16 AM\nTo: Dey, Souvik <sodey@sonusnet.com>; yuanhan.liu@linux.intel.com; stephen@networkplumber.org\nCc: dev@dpdk.org\nSubject: RE: [PATCH v7] net/virtio: add set_mtu in virtio\n\n>Hi All,\n>\tIs there any further comments or modifications required for this \n>patch, or what next steps do you guys suggest here ?\n\nHi Souvik,\n\nSome minor comments inline.\n\nThanks,\nMark\n\n>\n>--\n>Regards,\n>Souvik\n>\n>-----Original Message-----\n>From: Dey, Souvik\n>Sent: Saturday, October 1, 2016 10:09 AM\n>To: mark.b.kavanagh@intel.com; yuanhan.liu@linux.intel.com; \n>stephen@networkplumber.org; dev@dpdk.org\n>Subject: RE: [PATCH v7] net/virtio: add set_mtu in virtio\n>\n>Hi Liu/Stephen/Mark,\n>\n>\tI have submitted Version 7 of this patch. Do let me know if this looks proper.\n>\n>--\n>Regards,\n>Souvik\n>\n>-----Original Message-----\n>From: Dey, Souvik\n>Sent: Thursday, September 29, 2016 4:32 PM\n>To: mark.b.kavanagh@intel.com; yuanhan.liu@linux.intel.com; \n>stephen@networkplumber.org; dev@dpdk.org\n>Cc: Dey, Souvik <sodey@sonusnet.com>\n>Subject: [PATCH v7] net/virtio: add set_mtu in virtio\n>\n>\n>Virtio interfaces do not currently allow the user to specify a \n>particular Maximum Transmission Unit (MTU).Consequently, the MTU of \n>Virtio interfaces is typically set to the Ethernet default value of 1500.\n>This is problematic in the case of cloud deployments, in which a \n>specific (and potentially non-standard) MTU needs to be set by a DHCP \n>server, which needs to be honored by all interfaces across the traffic \n>path.To achieve this Virtio interfaces should support setting of MTU.\n>In case when GRE/VXLAN tunneling is used for internal communication, \n>there will be an overhead added by the infrastructure in the packet \n>over and above the ETHER MTU of 1518. So to take care of this overhead \n>in these cases the DHCP server corrects the L3 MTU to 1454. But since \n>virtio interfaces was not having the MTU set functionality that MTU \n>sent by the DHCP server was ignored and the instance will still send \n>packets with 1500 MTU which after encapsulation will become more than \n>1518 and eventually gets dropped in the infrastructure.\n>By adding an additional 'set_mtu' function to the Virtio driver, we can \n>honor the MTU sent by the DHCP server. The dhcp server/controller can \n>then leverage this 'set_mtu' functionality to resolve the above \n>mentioned issue of packets getting dropped due to incorrect size.\n>\n>\n>Signed-off-by: Souvik Dey <sodey@sonusnet.com>\n>\n>---\n>Changes in v7:\n>- Replaced the CRC_LEN with the merge rx buf header length.\n>- Changed the frame_len max validation to VIRTIO_MAX_RX_PKTLEN.\n>Changes in v6:\n>- Description of change corrected\n>- Corrected the identations\n>- Corrected the subject line too\n>- The From line was also not correct\n>- Re-submitting as the below patch was not proper Changes in v5:\n>- Fix log message for out-of-bounds MTU parameter in virtio_mtu_set\n>- Calculate frame size, based on 'mtu' parameter\n>- Corrected the upper bound and lower bound checks in virtio_mtu_set \n>Changes in v4: Incorporated review comments.\n>Changes in v3: Corrected few style errors as reported by sys-stv.\n>Changes in v2: Incorporated review comments.\n>\n> drivers/net/virtio/virtio_ethdev.c | 16 ++++++++++++++++\n> 1 file changed, 16 insertions(+)\n>\n>diff --git a/drivers/net/virtio/virtio_ethdev.c \n>b/drivers/net/virtio/virtio_ethdev.c\n>index 423c597..1dbfea6 100644\n>--- a/drivers/net/virtio/virtio_ethdev.c\n>+++ b/drivers/net/virtio/virtio_ethdev.c\n>@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)\n>                PMD_INIT_LOG(ERR, \"Failed to disable allmulticast\");  }\n>\n>+#define VLAN_TAG_LEN           4    /* 802.3ac tag (not DMA'd) */\n\nThere should be a blank line between the #define and the function prototype beneath.\n\n>+static int  virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {\n>+\tstruct virtio_hw *hw = dev->data->dev_private;\n>+\tuint32_t ether_hdr_len = ETHER_HDR_LEN + VLAN_TAG_LEN +\n>+\t\thw->vtnet_hdr_size;\n\nI'll rely on Stephen and Yuanhan's judgment for this.\n\n>+\tuint32_t frame_size = mtu + ether_hdr_len;\n>+\n>+\tif (mtu < ETHER_MIN_MTU || frame_size > VIRTIO_MAX_RX_PKTLEN) {\n>+\t\tPMD_INIT_LOG(ERR, \"MTU should be between %d and %d\\n\",\n>+\t\t\tETHER_MIN_MTU, VIRTIO_MAX_RX_PKTLEN);\n\nShouldn't last format print parameter should be (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len)?\ni.e PMD_INIT_LOG(ERR, \"MTU should........%d\\n\",\n          ETHER_MIN_MTU, (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len));\n\n>+\t\treturn -EINVAL;\n>+\t}\n>+\treturn 0;\n>+}\n>\n> /*\n>  * dev_ops for virtio, bare necessities for basic operation\n>  */\n>@@ -677,7 +685,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {\n> \t.allmulticast_enable     = virtio_dev_allmulticast_enable,\n> \t.allmulticast_disable    = virtio_dev_allmulticast_disable,\n>+\t.mtu_set                 = virtio_mtu_set,\n> \t.dev_infos_get           = virtio_dev_info_get,\n> \t.stats_get               = virtio_dev_stats_get,\n> \t.xstats_get              = virtio_dev_xstats_get,\n>--\n>2.9.3.windows.1",
    "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 423c597..1dbfea6 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -653,12 +653,20 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)\n                PMD_INIT_LOG(ERR, \"Failed to disable allmulticast\");\n } \n\n+#define VLAN_TAG_LEN           4    /* 802.3ac tag (not DMA'd) */\n+\n+static int  virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n+{\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n+\tuint32_t ether_hdr_len = ETHER_HDR_LEN + VLAN_TAG_LEN +\n+\t\thw->vtnet_hdr_size;\n+\tuint32_t frame_size = mtu + ether_hdr_len;\n+\n+\tif (mtu < ETHER_MIN_MTU || frame_size > VIRTIO_MAX_RX_PKTLEN) {\n+\t\tPMD_INIT_LOG(ERR, \"MTU should be between %d and %d\\n\",\n+\t\t\tETHER_MIN_MTU, (VIRTIO_MAX_RX_PKTLEN - ether_hdr_len));\n+\t\treturn -EINVAL;\n+\t}\n+\treturn 0;\n+}\n\nLet mem know if this looks good or we have few more comments. \n\n--\nRegards,\nSouvik\n\n-----Original Message-----\nFrom: Kavanagh, Mark B [mailto:mark.b.kavanagh@intel.com] \n",
    "prefixes": [
        "dpdk-dev",
        "v7"
    ]
}