From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1EED143FB3; Fri, 10 May 2024 14:20:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBAC4402C4; Fri, 10 May 2024 14:20:50 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7642B402BB for ; Fri, 10 May 2024 14:20:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715343649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wrHbCXMywt+R0WFqJWm0Gp2gvPOQgLsclGUPFxBl+OE=; b=AIi3tlzLB+A8gKdcWN0j/ScHlTyBdwBNZNlHNqJWqbAiUB/+ia4vEB2NMVApddnxNwI6Tr C/BqQAdBNiqWhCkyii/pfIJAOdKNRnUsAiBHab4Tt3FYvYFU7zyYutK/EaeUYUd8L7myNP OmeixRM5KQNye/R3zQ5MSmDoEmpyno0= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-2wMIqgGkNheuKjWe25Qf3g-1; Fri, 10 May 2024 08:20:47 -0400 X-MC-Unique: 2wMIqgGkNheuKjWe25Qf3g-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-52199633974so1702300e87.3 for ; Fri, 10 May 2024 05:20:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715343646; x=1715948446; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wrHbCXMywt+R0WFqJWm0Gp2gvPOQgLsclGUPFxBl+OE=; b=Lkn7XdlHcnA+aXXpDrRXGp6PbrcULeeDPbiJcoxSrdMFKTywND8gmJFPdEDmdfH1AW nS/70uhwCfJTMDj28JFtJXFhcAyxPW2pMKMZED9rKmvZuM3byX6CLmElSNoUSCp/MDwh KI223B6/5g0wKFbEko+sXxgj9yHjSrCu7Jp7EjxfiOYiO/UHHWf7RlK7wFR50qpjaOhh e8qLb6E6rPzuc0i5V1BXnDA0Ur0Cy1zFzL4qaNr9bWdFlbvL3ntui/7jFUxQcQ1MTUa9 1qGopNvqPbzAgUIphiGfnKDBGqgH9AulF4TZqNp9Z6V6NhxPSmFcN13PTgtyEw+e9YBq m7Fg== X-Gm-Message-State: AOJu0Yx9pvqSNHHDzEP3XsYz3NUgkgFARFot5PIAKuI9WG25E3BZShOd 2MJj4DSq66V4CPwO8657hCgxjHiWYygCHE8yGXqc+6hjPwQ7a18mcKuG8D1w7GGeALKuXLevx2g ST0J29y8RnKu6uCblr7P9LIPgdUco3dfdM6V02S+mfZkE+UX2TvCxQDJpBH/bqZVJEd0Z+wVvLb k50KCftNUNRpA8JFTsx7IUGh8= X-Received: by 2002:a05:6512:3d8e:b0:516:c763:b4f5 with SMTP id 2adb3069b0e04-5220fb69899mr1985991e87.3.1715343645998; Fri, 10 May 2024 05:20:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpblxRv9hSB8NTUo7wkvfsa5pKxylCipg8BZ4srQB1kvl60rmHxztjlKM5M/i4oP6nXFl21Q== X-Received: by 2002:a05:6512:3d8e:b0:516:c763:b4f5 with SMTP id 2adb3069b0e04-5220fb69899mr1985971e87.3.1715343645354; Fri, 10 May 2024 05:20:45 -0700 (PDT) Received: from [192.168.0.12] ([78.18.17.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502b8a7826sm4406410f8f.52.2024.05.10.05.20.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 May 2024 05:20:44 -0700 (PDT) Message-ID: Date: Fri, 10 May 2024 13:20:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] net/af_xdp: Fix port id not set in rx mbuf To: dev@dpdk.org References: <20240510100358.18815-1-ciara.loftus@intel.com> From: Maryam Tahhan In-Reply-To: <20240510100358.18815-1-ciara.loftus@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 10/05/2024 11:03, Ciara Loftus wrote: > Record the port id in the af_xdp rx queue structure and use it > to set the port id of the mbuf of a received packed. > > Bugzilla ID: 1428 > Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") > cc: stable@dpdk.og > > Reported-by: Stephen Hemminger > Signed-off-by: Ciara Loftus Acked-by:Maryam Tahhan > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 268a130c49..fee0d5d5f3 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -131,6 +131,7 @@ struct pkt_rx_queue { > struct xsk_umem_info *umem; > struct xsk_socket *xsk; > struct rte_mempool *mb_pool; > + uint16_t port; > > struct rx_stats stats; > > @@ -360,6 +361,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) > bufs[i]->data_off = offset - sizeof(struct rte_mbuf) - > rte_pktmbuf_priv_size(umem->mb_pool) - > umem->mb_pool->header_size; > + bufs[i]->port = rxq->port; > > rte_pktmbuf_pkt_len(bufs[i]) = len; > rte_pktmbuf_data_len(bufs[i]) = len; > @@ -426,6 +428,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) > rte_pktmbuf_data_len(mbufs[i]) = len; > rx_bytes += len; > bufs[i] = mbufs[i]; > + bufs[i]->port = rxq->port; > } > > xsk_ring_cons__release(rx, nb_pkts); > @@ -1779,6 +1782,8 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, > > process_private->rxq_xsk_fds[rx_queue_id] = rxq->fds[0].fd; > > + rxq->port = dev->data->port_id; > + > dev->data->rx_queues[rx_queue_id] = rxq; > return 0; >