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 0813AA0093 for ; Thu, 10 Mar 2022 11:42:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFA254113E; Thu, 10 Mar 2022 11:42:36 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 263764113E for ; Thu, 10 Mar 2022 11:42:35 +0100 (CET) Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B780D3F605 for ; Thu, 10 Mar 2022 10:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646908953; bh=gpcgELZYzot+MattRQ0NetVsXO9B9R7rvRwBBGF1Wn8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Rfgxuwf3IsXDasF0iLMcfhg00QmioM09o0XKcotlNjMRcOZCXsFk4fsIbLRhmevTx is4KLuwYGHN3GoI2ryk5e8MWyYHpAUtusB5vvxq7Gnbvotg1n6XgNBHY7guhvba3Dr 5S9XPU88IDZ1R56E3j3POlOWPK8aZQ3gE7pfjFKCW1PE2kvt/ygwByZeS8sPu4/9jV 1hbM9uys90KkmCKQQNS5gjIb8rFu6Y9hD4FnOuMyliQOwWdxlJV2hruSNZv53b5EVn 4E2UR3Xuiogdoh6s9h9TJoOQ6HSjg3AZ7DWg3cbgmxrrEwzCo7OiIMSftFKv0DG1ZY ch7kjnf7SNg8w== Received: by mail-qv1-f71.google.com with SMTP id j6-20020a056214032600b004358f15c51bso4497354qvu.1 for ; Thu, 10 Mar 2022 02:42:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gpcgELZYzot+MattRQ0NetVsXO9B9R7rvRwBBGF1Wn8=; b=IiyVZLA+yuLE+sRu5sInuHWwddbzyol8e+KqSWg6XqJFHuDSgjKBVEG8YU9PL7bDTs 7Qac3VZB2aVtE5HozskbDDamrvdIV1E7FyG0YDzoFNHj6w4z32A4oUh9zKQqE0l0rnVc W+2KDhLb7oVulJ2ih7t9eunxx31fBYjsuWzIwfNyYTTLnhxqYRx5aecpF3FZiDm97ye1 cl/xcYGSo41ho2XrAaPe/cHt+8VzQZsigkhNR+7nR2oKsUGtGgXElkKSCEXPpXPwlmix EnzA+FZyEQ4C5uatbfSFbNkYqA17nl2aZejPL7pXTZ5VZUj3mpbb52ZbwrxcdxII4Tl7 z9jQ== X-Gm-Message-State: AOAM532MzqBpFHe+g85keD5Er08kpI0JHVk4GDVylMQAJLYI1MATTbs/ +Ep7DZalkkMWRrBVM2N7Gpvwj1mvYgdvlFH3/TU7YbQeGHju0kCRA8YrwemqwFAst9iF1hyp5m7 Y4Twy49bz0degw517hYM6hv+J+UDpt2LVPqnRSKn8 X-Received: by 2002:a05:620a:f03:b0:67b:1465:d447 with SMTP id v3-20020a05620a0f0300b0067b1465d447mr2548170qkl.364.1646908952625; Thu, 10 Mar 2022 02:42:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7XCGFhwtJkBX3z4XNgGb/oSQOUWnfSPGi5yqDQElMlkhjmGnE9e9Dr27ofIC1KN+6+pt97AgNRFymSDNZ114= X-Received: by 2002:a05:620a:f03:b0:67b:1465:d447 with SMTP id v3-20020a05620a0f0300b0067b1465d447mr2548160qkl.364.1646908952371; Thu, 10 Mar 2022 02:42:32 -0800 (PST) MIME-Version: 1.0 References: <20220310100712.19709-1-ciara.loftus@intel.com> In-Reply-To: <20220310100712.19709-1-ciara.loftus@intel.com> From: Christian Ehrhardt Date: Thu, 10 Mar 2022 11:42:06 +0100 Message-ID: Subject: Re: [PATCH 19.11] net/af_xdp: ensure socket is deleted on Rx queue setup error To: Ciara Loftus Cc: stable@dpdk.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Thu, Mar 10, 2022 at 11:07 AM Ciara Loftus wrote: > > [ upstream commit b26431a617e4039e6c0f65c5ee56f62f347b686b ] > > During Rx queue setup the PMD attempts to allocate mbufs for the fill > queue after the socket is created. If this allocation fails, the socket > should be deleted before returning an error to the user. Fix this. > > Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") > > Signed-off-by: Ciara Loftus Thank you Ciara, applied > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 9eae705caa..9b36d80335 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -898,26 +898,27 @@ xsk_configure(struct pmd_internals *internals, struct pkt_rx_queue *rxq, > &txq->tx, &cfg); > if (ret) { > AF_XDP_LOG(ERR, "Failed to create xsk socket.\n"); > - goto err; > + goto out_umem; > } > > #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG) > ret = rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size); > if (ret) { > AF_XDP_LOG(DEBUG, "Failed to get enough buffers for fq.\n"); > - goto err; > + goto out_xsk; > } > #endif > ret = reserve_fill_queue(rxq->umem, reserve_size, fq_bufs); > if (ret) { > - xsk_socket__delete(rxq->xsk); > AF_XDP_LOG(ERR, "Failed to reserve fill queue.\n"); > - goto err; > + goto out_xsk; > } > > return 0; > > -err: > +out_xsk: > + xsk_socket__delete(rxq->xsk); > +out_umem: > xdp_umem_destroy(rxq->umem); > > return ret; > -- > 2.17.1 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd