From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id AEDBA2BF2 for ; Wed, 23 May 2018 14:11:25 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id n10-v6so8555686wmc.1 for ; Wed, 23 May 2018 05:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ha2dGXZo8nItW0pVXmU86YzzAeFgsrAsJSC5qbo7Mlg=; b=IMGIo4DJw1kqlMMieVsjXEdrjU/ipx0/LTvb1yk2yEcQ0WKxrGn3bITqPHofxUa2iS VC0uaUFA7Gv0LpSMIeogTRgfU3QmUte2w7Zqu/MwI50mV6ExUfvtKhbcHq1ZAD8gzVaT nQp2nfRCEADDkpiOG0K2GscMkF9YWvGZwWv8FwyUj5Y8Ffw8iYm3VcxdDwpW4ugtPZh6 yKsst5h3y01yeTbJjdzPgeb0Y88K64Ma6BaHEskaTF0vN9s7I+T/U6K3mysZGKXjKub+ OXt/BrdZbSRbTFL5jsBsQ9WTnoKjzp2BvJJQ8GPt7aYqB5azNo79vQfVV7SxkART4Y6B bT7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ha2dGXZo8nItW0pVXmU86YzzAeFgsrAsJSC5qbo7Mlg=; b=dZmn+w4tJvtaGteAKL6GdItLK+W0r4F0zpYkTD64bnP2WIxoOL+M7DXCdGa7EF1NIy Ff9d/an+h4a7pMSdb3DajNIxMJE05VwktNrXa6HI4Sdjt+iFeusxlPtCIU0XLwvlKDtw sSVM6Aj8Nbzkwo9/pK2rynFqL2OiO5VlnxDJBYe/5/akLR9+ZN/DFNqeh7tGDvS6o2pw a1BR21w7zRlJ61kc3IwKdOtY5m1hyxLo2rdLzapVBBJxOGVSQIRXY34x5zmJq6EnSnQT D+o7TWTRQl/yKfZ9x12q1tZ5zneieFM4ef4y7+F6yB7WYtEoecJ32Ii1owFVAXPI6hNa RF3A== X-Gm-Message-State: ALKqPwfo8SKJ3Ed1wsGkQHYeWFgw9LvEtqXR+Re9TQW0mi2467h81yUY 3RC4C3Q5F+2tNSdWFFmECBHzBcYq82o= X-Google-Smtp-Source: AB8JxZpmNmCxm9TRxOG1k1nBjcwihN7WSDNn2VsEEyWfTmkgaj3gsdD5ZiyOqqlSYK6XqXGkZspATg== X-Received: by 2002:a1c:e046:: with SMTP id x67-v6mr3722745wmg.154.1527077485380; Wed, 23 May 2018 05:11:25 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id c11-v6sm8525598wrb.57.2018.05.23.05.11.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 05:11:24 -0700 (PDT) From: luca.boccassi@gmail.com To: Zhiyong Yang Cc: Lei Yao , Bernard Iremonger , dpdk stable Date: Wed, 23 May 2018 13:09:54 +0100 Message-Id: <20180523121010.8385-43-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180523121010.8385-1-luca.boccassi@gmail.com> References: <20180516101323.2234-2-luca.boccassi@gmail.com> <20180523121010.8385-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 12:11:25 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/25/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 8e96cf1276094a75ad0d3fd32912c672489e9811 Mon Sep 17 00:00:00 2001 From: Zhiyong Yang Date: Fri, 18 May 2018 17:59:37 +0800 Subject: [PATCH] app/testpmd: fix exit for virtio-user [ upstream commit 124909d7e1bf299c959b58c2db7c5fbd7abbb7c0 ] For vdev, just calling rte_eth_dev_close() isn't enough to free all the resources allocated during device probe, e.g. for virtio-user, virtio_user_pmd_remove(), i.e. the remove() method of a vdev driver, needs to be called to unlink the socket file created during device probe. So this patch calls the rte_eth_dev_detach() for vdev when quitting testpmd. vdevs detach on testpmd exit implemented as workaround to fix a virtio-user issue. The issue was virtio-user cleanup is not called and existing socket file not cleaned up which will fail next run. Added a comment that this workaround should be converted to a proper cleanup, not something specific to virtio-user, and not something specific to vdev and testpmd. Fixes: af75078fece3 ("first public release") Fixes: bd8f50a45d0f ("net/virtio-user: support server mode") Signed-off-by: Zhiyong Yang Tested-by: Lei Yao Acked-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 05a68a068..98e0a9dc6 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1951,6 +1951,7 @@ detach_port(portid_t port_id) void pmd_test_exit(void) { + struct rte_device *device; portid_t pt_id; if (test_done == 0) @@ -1963,6 +1964,18 @@ pmd_test_exit(void) fflush(stdout); stop_port(pt_id); close_port(pt_id); + + /* + * This is a workaround to fix a virtio-user issue that + * requires to call clean-up routine to remove existing + * socket. + * This workaround valid only for testpmd, needs a fix + * valid for all applications. + * TODO: Implement proper resource cleanup + */ + device = rte_eth_devices[pt_id].device; + if (device && !strcmp(device->driver->name, "net_virtio_user")) + detach_port(pt_id); } } printf("\nBye...\n"); -- 2.14.2