get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105051,
    "url": "http://patchwork.dpdk.org/api/patches/105051/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20211209171947.25340-1-ciara.loftus@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20211209171947.25340-1-ciara.loftus@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211209171947.25340-1-ciara.loftus@intel.com",
    "date": "2021-12-09T17:19:47",
    "name": "net/af_xdp: fix build with -Wunused-function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "70d99e11e3b8a5b03b9bade1bcb22932f932c5eb",
    "submitter": {
        "id": 144,
        "url": "http://patchwork.dpdk.org/api/people/144/?format=api",
        "name": "Loftus, Ciara",
        "email": "ciara.loftus@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20211209171947.25340-1-ciara.loftus@intel.com/mbox/",
    "series": [
        {
            "id": 20901,
            "url": "http://patchwork.dpdk.org/api/series/20901/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20901",
            "date": "2021-12-09T17:19:47",
            "name": "net/af_xdp: fix build with -Wunused-function",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/20901/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/105051/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/105051/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3A0FDA0093;\n\tThu,  9 Dec 2021 18:23:00 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C43214014F;\n\tThu,  9 Dec 2021 18:22:59 +0100 (CET)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id C4A1F40041;\n Thu,  9 Dec 2021 18:22:57 +0100 (CET)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Dec 2021 09:20:20 -0800",
            "from unknown (HELO localhost.localdomain) ([10.55.129.110])\n by fmsmga008.fm.intel.com with ESMTP; 09 Dec 2021 09:20:18 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1639070578; x=1670606578;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=OP5jPj0HfScaOXXj+1KywZUIa82ZWyOrYspTJb/eDrY=;\n b=bBdYX5CEMGjNYyOhENywB3loRwPdYtYm+5CtitZUuSTGtGTYfVVrXpiA\n 3EpAPNZOFEmtTYEAe5gVI7sN1OxtfjC7QYY+xvTwIA8o3k1hsPqkKZmyO\n qCCdEyp0Q7itbg2ASMRgSmBKbiuoK3DOhic2ysrzkHSVSngz2Uca/7DzQ\n e3MjLorgqYNAasK4vhRjoG4Eq3aufnXOAaH7QpGqUMMFy1H2LKTY+em+T\n kD0PHTLg+YkRePkG+wR5r0upbY+pWjxZ+garfyP6Fp+QAubG0AlAjS+IT\n EeozBr8LbGzQFhDtAH+W3Q0ipQv2bxKDnOV3bNztTNEapWJz9Uj7sul3U g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10193\"; a=\"225026198\"",
            "E=Sophos;i=\"5.88,193,1635231600\"; d=\"scan'208\";a=\"225026198\"",
            "E=Sophos;i=\"5.88,193,1635231600\"; d=\"scan'208\";a=\"564897391\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ciara Loftus <ciara.loftus@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ciara Loftus <ciara.loftus@intel.com>,\n\tstable@dpdk.org",
        "Subject": "[PATCH] net/af_xdp: fix build with -Wunused-function",
        "Date": "Thu,  9 Dec 2021 17:19:47 +0000",
        "Message-Id": "<20211209171947.25340-1-ciara.loftus@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "The get_shared_umem function is only called when the kernel\nflag XDP_UMEM_UNALIGNED_CHUNK_FLAG is defined. Move the\nfunction implementation and associated helper so that it only\ngets compiled when that flag is set.\n\nFixes: 74b46340e2d4 (\"net/af_xdp: support shared UMEM\")\nCc: stable@dpdk.org\n\nSigned-off-by: Ciara Loftus <ciara.loftus@intel.com>\n---\n drivers/net/af_xdp/rte_eth_af_xdp.c | 121 ++++++++++++++--------------\n 1 file changed, 60 insertions(+), 61 deletions(-)",
    "diff": "diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c\nindex 96c2c9d939..b3ed704b36 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -697,67 +697,6 @@ find_internal_resource(struct pmd_internals *port_int)\n \treturn list;\n }\n \n-/* Check if the netdev,qid context already exists */\n-static inline bool\n-ctx_exists(struct pkt_rx_queue *rxq, const char *ifname,\n-\t\tstruct pkt_rx_queue *list_rxq, const char *list_ifname)\n-{\n-\tbool exists = false;\n-\n-\tif (rxq->xsk_queue_idx == list_rxq->xsk_queue_idx &&\n-\t\t\t!strncmp(ifname, list_ifname, IFNAMSIZ)) {\n-\t\tAF_XDP_LOG(ERR, \"ctx %s,%i already exists, cannot share umem\\n\",\n-\t\t\t\t\tifname, rxq->xsk_queue_idx);\n-\t\texists = true;\n-\t}\n-\n-\treturn exists;\n-}\n-\n-/* Get a pointer to an existing UMEM which overlays the rxq's mb_pool */\n-static inline int\n-get_shared_umem(struct pkt_rx_queue *rxq, const char *ifname,\n-\t\t\tstruct xsk_umem_info **umem)\n-{\n-\tstruct internal_list *list;\n-\tstruct pmd_internals *internals;\n-\tint i = 0, ret = 0;\n-\tstruct rte_mempool *mb_pool = rxq->mb_pool;\n-\n-\tif (mb_pool == NULL)\n-\t\treturn ret;\n-\n-\tpthread_mutex_lock(&internal_list_lock);\n-\n-\tTAILQ_FOREACH(list, &internal_list, next) {\n-\t\tinternals = list->eth_dev->data->dev_private;\n-\t\tfor (i = 0; i < internals->queue_cnt; i++) {\n-\t\t\tstruct pkt_rx_queue *list_rxq =\n-\t\t\t\t\t\t&internals->rx_queues[i];\n-\t\t\tif (rxq == list_rxq)\n-\t\t\t\tcontinue;\n-\t\t\tif (mb_pool == internals->rx_queues[i].mb_pool) {\n-\t\t\t\tif (ctx_exists(rxq, ifname, list_rxq,\n-\t\t\t\t\t\tinternals->if_name)) {\n-\t\t\t\t\tret = -1;\n-\t\t\t\t\tgoto out;\n-\t\t\t\t}\n-\t\t\t\tif (__atomic_load_n(\n-\t\t\t\t\t&internals->rx_queues[i].umem->refcnt,\n-\t\t\t\t\t\t\t__ATOMIC_ACQUIRE)) {\n-\t\t\t\t\t*umem = internals->rx_queues[i].umem;\n-\t\t\t\t\tgoto out;\n-\t\t\t\t}\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-out:\n-\tpthread_mutex_unlock(&internal_list_lock);\n-\n-\treturn ret;\n-}\n-\n static int\n eth_dev_configure(struct rte_eth_dev *dev)\n {\n@@ -1013,6 +952,66 @@ static inline uintptr_t get_base_addr(struct rte_mempool *mp, uint64_t *align)\n \treturn aligned_addr;\n }\n \n+/* Check if the netdev,qid context already exists */\n+static inline bool\n+ctx_exists(struct pkt_rx_queue *rxq, const char *ifname,\n+\t\tstruct pkt_rx_queue *list_rxq, const char *list_ifname)\n+{\n+\tbool exists = false;\n+\n+\tif (rxq->xsk_queue_idx == list_rxq->xsk_queue_idx &&\n+\t\t\t!strncmp(ifname, list_ifname, IFNAMSIZ)) {\n+\t\tAF_XDP_LOG(ERR, \"ctx %s,%i already exists, cannot share umem\\n\",\n+\t\t\t\t\tifname, rxq->xsk_queue_idx);\n+\t\texists = true;\n+\t}\n+\n+\treturn exists;\n+}\n+\n+/* Get a pointer to an existing UMEM which overlays the rxq's mb_pool */\n+static inline int\n+get_shared_umem(struct pkt_rx_queue *rxq, const char *ifname,\n+\t\t\tstruct xsk_umem_info **umem)\n+{\n+\tstruct internal_list *list;\n+\tstruct pmd_internals *internals;\n+\tint i = 0, ret = 0;\n+\tstruct rte_mempool *mb_pool = rxq->mb_pool;\n+\n+\tif (mb_pool == NULL)\n+\t\treturn ret;\n+\n+\tpthread_mutex_lock(&internal_list_lock);\n+\n+\tTAILQ_FOREACH(list, &internal_list, next) {\n+\t\tinternals = list->eth_dev->data->dev_private;\n+\t\tfor (i = 0; i < internals->queue_cnt; i++) {\n+\t\t\tstruct pkt_rx_queue *list_rxq =\n+\t\t\t\t\t\t&internals->rx_queues[i];\n+\t\t\tif (rxq == list_rxq)\n+\t\t\t\tcontinue;\n+\t\t\tif (mb_pool == internals->rx_queues[i].mb_pool) {\n+\t\t\t\tif (ctx_exists(rxq, ifname, list_rxq,\n+\t\t\t\t\t\tinternals->if_name)) {\n+\t\t\t\t\tret = -1;\n+\t\t\t\t\tgoto out;\n+\t\t\t\t}\n+\t\t\t\tif (__atomic_load_n(&internals->rx_queues[i].umem->refcnt,\n+\t\t\t\t\t\t    __ATOMIC_ACQUIRE)) {\n+\t\t\t\t\t*umem = internals->rx_queues[i].umem;\n+\t\t\t\t\tgoto out;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+out:\n+\tpthread_mutex_unlock(&internal_list_lock);\n+\n+\treturn ret;\n+}\n+\n static struct\n xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,\n \t\t\t\t  struct pkt_rx_queue *rxq)\n",
    "prefixes": []
}