Show a cover letter.

GET /api/covers/64667/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 64667,
    "url": "http://patches.dpdk.org/api/covers/64667/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/cover/20200114142517.29522-1-aostruszka@marvell.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": "<20200114142517.29522-1-aostruszka@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200114142517.29522-1-aostruszka@marvell.com",
    "date": "2020-01-14T14:25:14",
    "name": "[RFC,0/3] introduce IF proxy library",
    "submitter": {
        "id": 1429,
        "url": "http://patches.dpdk.org/api/people/1429/?format=api",
        "name": "Andrzej Ostruszka [C]",
        "email": "aostruszka@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/cover/20200114142517.29522-1-aostruszka@marvell.com/mbox/",
    "series": [
        {
            "id": 8119,
            "url": "http://patches.dpdk.org/api/series/8119/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8119",
            "date": "2020-01-14T14:25:14",
            "name": "introduce IF proxy library",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8119/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/covers/64667/comments/",
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id CAAB8A04FF;\n\tTue, 14 Jan 2020 15:25:25 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id EB57D1C0DD;\n\tTue, 14 Jan 2020 15:25:24 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 2D51A1C0D6\n for <dev@dpdk.org>; Tue, 14 Jan 2020 15:25:23 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 00EEKUIm013363 for <dev@dpdk.org>; Tue, 14 Jan 2020 06:25:22 -0800",
            "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0a-0016f401.pphosted.com with ESMTP id 2xhc6sgng8-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 14 Jan 2020 06:25:22 -0800",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jan\n 2020 06:25:20 -0800",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Tue, 14 Jan 2020 06:25:20 -0800",
            "from amok.marvell.com (unknown [10.95.130.253])\n by maili.marvell.com (Postfix) with ESMTP id D1FD63F703F;\n Tue, 14 Jan 2020 06:25:18 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : mime-version : content-transfer-encoding :\n content-type; s=pfpt0818; bh=xuXcd58IgGzKJifWxjuV6ScfKyOCyS2WFjpSMnmcZ0A=;\n b=vSTKBHeYi1fXxj0CHuKfmtN8dcg7N6D0UPbTBUNCYbhdTcnj/KG8pI+C+YtkDO53en0F\n aLYyVRqRQJ5+DVb1UsIQd3RNB1Im9CgLIrFn/Lwff8YnKS1VOky3k/aGQnGY/92OgX5E\n tH1Nqo0A0fSmARP2ZtiRuJC+P3I4Tz9glOFae7NSj0xrvluH3KUZG/gMws+Yti1/RR+N\n 353pO6uamgJAkezjh5aQmqwkfeNcTMI/McaBLsdFl+IyF6EzaCTjkfr6sXx2q4cQM4x9\n eMIUfr5rD0makHD9v0AXQPbZK95GFi9u2bUGg6DkdDnyQFZYkzuzhGbnJXltlytmmqwf +w==",
        "From": "Andrzej Ostruszka <aostruszka@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Jerin Jacob Kollanukkaran <jerinj@marvell.com>, Nithin Kumar Dabilpuram\n <ndabilpuram@marvell.com>, Pavan Nikhilesh Bhagavatula\n <pbhagavatula@marvell.com>, Kiran Kumar Kokkilagadda\n <kirankumark@marvell.com>, Krzysztof Kanas <kkanas@marvell.com>",
        "Date": "Tue, 14 Jan 2020 15:25:14 +0100",
        "Message-ID": "<20200114142517.29522-1-aostruszka@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572\n definitions=2020-01-14_04:2020-01-13,\n 2020-01-14 signatures=0",
        "Subject": "[dpdk-dev] [RFC PATCH 0/3] introduce IF proxy library",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "What is this useful for\n=======================\n\nUsually, when an ethernet port is assigned to DPDK it vanishes from the\nsystem and user looses ability to control it via normal configuration\nutilities (e.g. those from iproute2 package).  Moreover by default DPDK\napplication is not aware of the network configuration of the system.\n\nTo address both of these issues application needs to:\n- add some command line interface (or other mechanism) allowing for\n  control of the port and its configuration\n- query the status of network configuration and monitor its changes\n\nThe purpose of this library is to help with both of these tasks (as long\nas they remain in domain of configuration available to the system).  In\nother words, if DPDK application has some special needs, that cannot be\naddressed by the normal system configuration utilities, then they need\nto be solved by the application itself.\n\nThe connection between DPDK and system is based on the existence of\nports that are visible to both DPDK and system (like Tap, KNI and\npossibly some other drivers).  These ports serve as an interface\nproxies.\n\nLet's visualize the action of the library by the following example:\n\n              Linux             |            DPDK\n==============================================================\n                                |\n                                |   +-------+       +-------+\n                                |   | Port1 |       | Port2 |\n\"ip link set dev tap1 mtu 1600\" |   +-------+       +-------+\n                          |     |       ^               ^\n                          |  +------+   | mtu_change    |\n                          `->| Tap1 |---' callback      |\n                             +------+                   |\n\"ip addr add 198.51.100.14 \\    |                       |\n                  dev tap2\"     |                       |\n                          |  +------+                   |\n                          `->| Tap2 |-------------------'\n                             +------+   addr_add callback \n                                |\n\"ip route add 198.0.2.0/24 \\    |\n                  dev eth0\"     |\n                          |     |   route_add callback\n                          `------------->\n                                |\n\nSo we have two ports Port1 and Port2 that are not visible to the system.\nWe create two proxy interfaces (here based on Tap driver) and bind the\nports to their proxies.  When user issues a command changing MTU for\nTap1 interface the library notes this and calls \"mtu_change\" callback\nfor the Port1.  Similarly when user adds an IPv4 address to the Tap2\ninterface \"addr_add\" callback is called for the Port2.  Note also that\nthat not only port related callbacks are available - for example you can\nalso get information about routing table.  See below for a complete list\nof available callbacks.\n\nPlease note that nothing has been mentioned about forwarding of the\npackets between system and DPDK.  Since the proxies are normal DPDK\nports you can receive/send to them via usual RX/TX burst API.  However\nsince the library is not aware of the structure of packet processing\nused by the application it cannot automatically forward the packets - it\nis responsibility of the application to include proxy ports into its\npacket processing engine.\n\nAs mentioned above the intention of the library is to:\n- provide information about network configuration that would allow\n  application to decide what to do with the packets received on DPDK\n  ports,\n- allow for control of the ports via standard configuration utilities\n\nAlthough the library only helps you to identify proxy for given port\n(and vice versa) and calls appropriate callbacks it does open some\ninteresting possibilities.  For example you can use the proxy ports to\nforward packets for protocols that you do not wish to handle in DPDK\napplication to the system protocol stack and just listen to the\nconfiguration changes - so that way you can \"offload\" handling of those\nprotocols to the system.\n\n\nWhy this RFC\n============\n\nWe would like to solicit some input from the community:\n- regarding usefulness of this library\n- what is missing or what needs to be changed\n- about currently proposed API\n- any other suggestions and/or improvements are also welcome\n\n\nHow to use it\n=============\n\nUsage of this library is rather simple.  You have to:\n1. Create proxy (if you don't have port suitable for being proxy or you\n  have one but do not wish to use it as a proxy).\n2. Bind port to proxy.\n3. Register callbacks.\n4. Start listening to the network configuration.\n\nThe only mandatory requirement for DPDK port to be able to act as\na proxy is that it is visible in the system - this is checked during\nport to proxy binding by calling rte_eth_dev_info_get() on proxy port\nand inspecting 'if_index' field (it has to be non-zero).\nOne can create such port in the application by calling:\n\n  proxy_id = rte_ifpx_create(RTE_IFPX_DEFAULT);\n\nUpon success this returns id of DPDK proxy port created\n(RTE_MAX_ETHPORTS on failure).  The argument selects type of proxy port\nto create (currently Tap/KNI only).  This function actually is just\na wrapper around:\n\n  uint16_t rte_ifpx_create_by_devarg(const char *devarg);\n\ncreating valid 'devarg' string for the chosen type of proxy.  If you have\nother driver capable of acting as a proxy you can call\nrte_ifpx_create_by_devarg() directly passing appropriate argument.\n\nOnce you have id of both port and proxy you can bind the two via:\n\n  rte_ifpx_port_bind(port_id, proxy_id);\n\nThis creates logical binding - as mentioned above there is no automatic\npacket forwarding.  With this binding whenever user changes the state of\nproxy interface in the system (link up/down, change mac/mtu, add/remove\nIPv4/IPv6) you get appropriate callback called for the bound port.\n\nSo far we've mentioned several times that the library calls callbacks.\nThey are grouped in 'struct rte_ifpx_callbacks' and user provides them\nto the library via:\n\n  rte_ifpx_callbacks_register(&cbs);\n\nIt is worth mentioning that the context (lcore/thread) in which these\ncallbacks are called is implementation defined.  It might differ between\ndifferent platforms, so the application needs to assume that some kind\nof inter lcore/thread synchronization/communication is required.\n\nOnce we have bindings in place and callbacks registered, the only\nessential part that remains is to get the current network configuration\nand start listening to its changes.  This is accomplished via a call to:\n\n  rte_ifpx_listen();\n\nAnd basically this is all one needs to understand how to use this\nlibrary.  Other less essential parts include:\n- ability to query what callbacks are available for given platform\n- getting mapping between proxy and port\n- unbinding the ports from proxy\n- destroying proxy port\n- closing the listening service\n- getting basic information about proxy\n\n\nCurrently available features and implementation\n===============================================\n\nThe library's API is system independent but it obviously needs some\nsystem dependent parts.  We provide exemplary Linux implementation (based\non netlink sockets).  Very similar implementation is possible for\nFreeBSD (with the usage of PF_ROUTE sockets).  Windows implementation\nwould need to differ much (probably IP Helper library would be of some help).\n\nHere is the list of currently implemented callbacks:\n\nstruct rte_ifpx_callbacks {\n  void  (*mac_change)(uint16_t port_id, const struct rte_ether_addr *mac);\n  void  (*mtu_change)(uint16_t port_id, uint16_t mtu);\n  void (*link_change)(uint16_t port_id, int is_up);\n  void    (*addr_add)(uint16_t port_id, uint32_t ip);\n  void    (*addr_del)(uint16_t port_id, uint32_t ip);\n  void   (*addr6_add)(uint16_t port_id, const uint8_t *ip);\n  void   (*addr6_del)(uint16_t port_id, const uint8_t *ip);\n  void   (*route_add)(uint32_t ip, uint8_t depth);\n  void   (*route_del)(uint32_t ip, uint8_t depth);\n  void  (*route6_add)(const uint8_t *ip, uint8_t depth);\n  void  (*route6_del)(const uint8_t *ip, uint8_t depth);\n  void (*cfg_finished)(void);\n};\n\nThey are all rather self-descriptive with the exception of the last one.\nWhen the user calls rte_ifpx_listen() the library first queries the\nsystem for its current configuration.  That might require several\nrequest/reply exchanges between DPDK and system and once it is finished\nthis callback is called to let application know that all info has been\ngathered.\n\nBTW at the moment all IPv4 addresses are passed in host order.\n\nIt is worth to mention also that while typical case would be a 1-to-1\nmapping between port and proxy, the 1-to-many mapping is also supported.\nIn that case port related callbacks will be called for each port bound\nto given proxy interface - in that case it is application responsibility\nto define semantic of such mapping (e.g. all changes apply to all ports,\nor link changes apply to all but other are accepted in \"round robin\"\nfashion, or ...).\n\nAs mentioned above Linux implementation is based on netlink socket.\nThis socket is registered as file descriptor in EAL interrupts\n(similarly to how EAL alarms are implemented).\n\n\nWhat is inside this RFC\n=======================\n- 1 commit for API\n- 1 commit for implementation - this is just to show PoC, and allow for\n  early playing around with the idea (e.g. run the test/example from the\n  next commit)\n- 1 commit for test/example - just to show how this can be used\n\n\nNext steps\n==========\n\n- gather community feedback\n- polish the implementation:\n  * call the notification callbacks without lock held (at the moment\n    attempts to modify callbacks from within the callback would deadlock)\n  * separate the system dependent parts from the rest so that it is easy\n    to figure out what needs to be reimplemented on different platforms\n  * apply community suggestions - if any\n- add neighbour callbacks (ARP table)\n\nBest regards\nAndrzej Ostruszka\n\nAndrzej Ostruszka (3):\n  lib: introduce IF proxy library (API)\n  if_proxy: add preliminary Linux implementation\n  if_proxy: add example, test and documentation\n\n app/test/Makefile                             |   5 +\n app/test/meson.build                          |   1 +\n app/test/test_if_proxy.c                      | 431 ++++++++++\n config/common_base                            |   5 +\n doc/guides/prog_guide/if_proxy_lib.rst        | 103 +++\n doc/guides/prog_guide/index.rst               |   1 +\n examples/Makefile                             |   1 +\n examples/if_proxy/Makefile                    |  58 ++\n examples/if_proxy/main.c                      | 203 +++++\n examples/if_proxy/meson.build                 |  12 +\n examples/meson.build                          |   2 +-\n lib/Makefile                                  |   2 +\n .../common/include/rte_eal_interrupts.h       |   2 +\n lib/librte_eal/linux/eal/eal_interrupts.c     |  14 +-\n lib/librte_if_proxy/Makefile                  |  25 +\n lib/librte_if_proxy/meson.build               |   7 +\n lib/librte_if_proxy/rte_if_proxy.c            | 803 ++++++++++++++++++\n lib/librte_if_proxy/rte_if_proxy.h            | 364 ++++++++\n lib/meson.build                               |   2 +-\n 19 files changed, 2035 insertions(+), 6 deletions(-)\n create mode 100644 app/test/test_if_proxy.c\n create mode 100644 doc/guides/prog_guide/if_proxy_lib.rst\n create mode 100644 examples/if_proxy/Makefile\n create mode 100644 examples/if_proxy/main.c\n create mode 100644 examples/if_proxy/meson.build\n create mode 100644 lib/librte_if_proxy/Makefile\n create mode 100644 lib/librte_if_proxy/meson.build\n create mode 100644 lib/librte_if_proxy/rte_if_proxy.c\n create mode 100644 lib/librte_if_proxy/rte_if_proxy.h"
}