From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 5F81C5B1E for ; Mon, 28 Jan 2019 14:49:31 +0100 (CET) Received: by mail-pf1-f193.google.com with SMTP id b85so8028931pfc.3 for ; Mon, 28 Jan 2019 05:49:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nfware-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fw4pBvX1ZUZEjWLaTqnVNDooQHQcFansGw5heYYbors=; b=IK4sfNFZls8RRMHvxemxaA1AN52L6XZTIpu4q1HjuokHVvU/gkQj2lpclWGjuwganK p7vkBoI8cZGxp8QiUGQ3Prnz3CzUQq+QoTtuiaAPf/NLFqLlduEe91AlFRnyVGPhPaPB abdx5INZSW//nctG8zDMSOhAiJtgIbTLLy0uoM1dd3esMSWZwUk96IZO2VUf6BdJGueU WyEoBQ3lqskw3R5JCnCGzOgk76FSpqkOVIJxlJzBG96s7zNk/HRWcDqLtnrh/AzVEZE1 IKE4NF+nI0E3zJCSjVDcjv6A0LixbmoC8tQZ0tA6yWvddvQFZd3s+4ByTSsJ/hawMgkT 6SyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fw4pBvX1ZUZEjWLaTqnVNDooQHQcFansGw5heYYbors=; b=h2PDNNEFVNbiogPCAgqnxgPw/x//nF323biADUF+OkXrmqqMjRwLePS8Be27+/BoGq QRXS8FPDgUWFNulrhGxSiJisLHhLB6CyxzipC/ffm/k/uC7VR2r4UM70eS6VYd6e8u3z rl3/gnoSDI/s1PmqnbbeKl7sWwEqUgh7y27hzgQjPsENlcGjURd2jQ6xmjfoU2tmQ8Xl OLlV0hXCHt8cSL+girtsdKu0xBVJHofW7UWBo2GGtqFjXGycczeiCLOWqZ7AuWrY1GKj Fmdtx1muh1Lf17GOdZMdbLB6nWk4VNIvMvTOpvcpcPBmyVedHjHtuaxfUpAiDnuGZbCN nAPg== X-Gm-Message-State: AJcUukdYweWdXd/j4xYLJDxpcQ4pTJfWcGAMRWAhOG/+1dYB9GSYWOEF lBTAKQ0ec30W5PNxNrvtXP1RlWfZkWn57vNx+jiFOA== X-Google-Smtp-Source: ALg8bN7TPYfOYU4OLb/Ks/jKGT0R9r2PldNJEYgmKHgDFYAcwkU73RcqJYZCHVbFhJ2oR2Zm4Yk9vdE5dsCYL7Wn4CE= X-Received: by 2002:a63:ab08:: with SMTP id p8mr19543839pgf.87.1548683370518; Mon, 28 Jan 2019 05:49:30 -0800 (PST) MIME-Version: 1.0 References: <20190124204749.49912-1-iryzhov@nfware.com> In-Reply-To: From: Igor Ryzhov Date: Mon, 28 Jan 2019 16:49:19 +0300 Message-ID: To: Ferruh Yigit Cc: stable@dpdk.org, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH] kni: fix rte_kni_update_link 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: Mon, 28 Jan 2019 13:49:31 -0000 Hi again, Sorry for bothering, I should have done more testing. It works as it is now. So, self NACK on the patch. Best regards, Igor On Mon, Jan 28, 2019 at 2:45 PM Igor Ryzhov wrote: > Hi Ferruh, > > Can you, please, take a look at this patch? > The current implementation is broken, I think the patch should be merged > into 19.02 and 18.11.1. > > Best regards, > Igor > > On Thu, Jan 24, 2019 at 11:47 PM Igor Ryzhov wrote: > >> After read, file offset must be set to 0 before write. >> Otherwise, the third byte will be overwritten instead of the first. >> >> Fixes: c6fd54f28c24 ("kni: add function to set link state on kernel >> interface") >> Cc: stable@dpdk.org >> >> Signed-off-by: Igor Ryzhov >> --- >> lib/librte_kni/rte_kni.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c >> index 73aeccccf..5899bb14a 100644 >> --- a/lib/librte_kni/rte_kni.c >> +++ b/lib/librte_kni/rte_kni.c >> @@ -746,6 +746,12 @@ rte_kni_update_link(struct rte_kni *kni, unsigned >> int linkup) >> } >> old_linkup = (old_carrier[0] == '1'); >> >> + if (lseek(fd, 0, SEEK_SET) == -1) { >> + RTE_LOG(ERR, KNI, "Failed to change file position: >> %s.\n", path); >> + close(fd); >> + return -1; >> + } >> + >> new_carrier = linkup ? "1" : "0"; >> ret = write(fd, new_carrier, 1); >> if (ret < 1) { >> -- >> 2.20.1 >> >>