From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD51AA052B; Wed, 29 Jul 2020 19:02:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19F4F1023; Wed, 29 Jul 2020 19:02:25 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 361033B5 for ; Wed, 29 Jul 2020 19:02:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596042142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sAKOQ7LZErdFDwl8OlGJG+YhDs0Qugui/FEjOa6qNw8=; b=No43DNs1IuhcvR6s56RKcJMPo1T14X8z0jchhg79wzjgvKKXDItSMfVQVm/PXgo7NAfXPs +XN8Q+JIUOidEvhAqBlRr9H+k6GGWgZzi3+e9z9CG96vdMzooEOSu9een0IwpflqJ5T5UY YChtpDIo59h6VhJbPzitljSrgPnEQUg= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-LU_LGG8AMciUbox8cK_PPg-1; Wed, 29 Jul 2020 13:02:17 -0400 X-MC-Unique: LU_LGG8AMciUbox8cK_PPg-1 Received: by mail-vs1-f69.google.com with SMTP id l26so3232393vsb.23 for ; Wed, 29 Jul 2020 10:02:17 -0700 (PDT) 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=sAKOQ7LZErdFDwl8OlGJG+YhDs0Qugui/FEjOa6qNw8=; b=bJPqmEQgVWNWcLUTi85tkuXiXlwDBKl6qTxLblegFcFjGW4rXWubmJk7u0KlE2knZ5 SFf4OXO4lA5Z6MTCK5OTqYvFE4yl0G3NIoSgvMV8XFHz97gohxsfqjHoR6Jq0oQadnY4 ur8F/Fhl1TfE0hmcdbRPuUFqHtmGAcqC3qVO5A6gVbL6C6oH01FeJRzb1m+4oIZyu095 Lhiq2WDDnplRIWs26ooH6etJdrkZn6Xpx+aGHVwMz8WYNc+6DLgHkqxppg8lan3gZZUG KzQDFFKSS4zL1dnULscw1FbQesRTLDB0cnOXbayJE0ADAOj4sBPYN14SAHXPwXjUQa58 DZCg== X-Gm-Message-State: AOAM5339FDEAIO+uncIoqQMZJUIrgspucwZROjQM1C8xI9MC8L2OSRFu oeZ/qrtX6XnrAV1j0EgV8AxMfgjs1Y83m7/X74UcJH8EcEx2humVTCmhvuXdDCJeczSm0vnhofU siTK10I5G3UGIcgDvyHE= X-Received: by 2002:a67:cb9c:: with SMTP id h28mr24485604vsl.39.1596042136970; Wed, 29 Jul 2020 10:02:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ5YGNghSbj3XdkVo9gIcL5o4kDcfxuew9xpF6RtXj5dEFZJVpaLKK8aEcS5GqvXiNtUwyMerkwuWxTj/Kqas= X-Received: by 2002:a67:cb9c:: with SMTP id h28mr24485566vsl.39.1596042136583; Wed, 29 Jul 2020 10:02:16 -0700 (PDT) MIME-Version: 1.0 References: <20200701074941.3847658-1-ferruh.yigit@intel.com> <20200724151028.1297434-1-ferruh.yigit@intel.com> In-Reply-To: <20200724151028.1297434-1-ferruh.yigit@intel.com> From: David Marchand Date: Wed, 29 Jul 2020 19:02:05 +0200 Message-ID: To: Ferruh Yigit Cc: dev , Jecky Pei Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] net/kni: set packet input port in Rx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jul 24, 2020 at 5:10 PM Ferruh Yigit wrote: > > From: jiancheng pei > > Store port_id in pmd_internals when eth kni device is created. > Then set packet port of rte_mbuf in function eth_kni_rx. LGTM. Is this fix worth a backport? A net driver is expected to set the port in all mbufs (m->port is initialised/reset to MBUF_INVALID_PORT). > > Signed-off-by: Jecky Pei > Reviewed-by: Ferruh Yigit > --- > drivers/net/kni/rte_eth_kni.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c > index cde98f0bb2..831fe96c96 100644 > --- a/drivers/net/kni/rte_eth_kni.c > +++ b/drivers/net/kni/rte_eth_kni.c > @@ -47,6 +47,7 @@ struct pmd_queue { > > struct pmd_internals { > struct rte_kni *kni; > + uint16_t port_id; > int is_kni_started; > > pthread_t thread; > @@ -78,8 +79,11 @@ eth_kni_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) > struct pmd_queue *kni_q = q; > struct rte_kni *kni = kni_q->internals->kni; > uint16_t nb_pkts; > + int i; > > nb_pkts = rte_kni_rx_burst(kni, bufs, nb_bufs); > + for (i = 0; i < nb_pkts; i++) > + bufs[i]->port = kni_q->internals->port_id; > > kni_q->rx.pkts += nb_pkts; > > @@ -372,6 +376,7 @@ eth_kni_create(struct rte_vdev_device *vdev, > return NULL; > > internals = eth_dev->data->dev_private; > + internals->port_id = eth_dev->data->port_id; > data = eth_dev->data; > data->nb_rx_queues = 1; > data->nb_tx_queues = 1; > -- > 2.25.4 > -- David Marchand