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 5B946425C9; Mon, 18 Sep 2023 04:33:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A6A140395; Mon, 18 Sep 2023 04:33:55 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 92C52402B1 for ; Mon, 18 Sep 2023 04:33:53 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1c337aeefbdso37960135ad.0 for ; Sun, 17 Sep 2023 19:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1695004433; x=1695609233; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=nTmir5rn3UlIrKR7p15dZ7vWzRExoEUjiRCPzxjaJGs=; b=gLiODFGr96MuZ3W1kvkvfkZ6gav0C+jji/MMXrpB0Ng13t+7jHQxnRyrFA2YK5LkBq i4hCTZExLfSxeOQ2/nCYqmYmcEfdpLJ18fxFb+F9R5TTO8XrtA+AAQhGKJvO0DzTAhVn iqota4d2BYLUvi8LKhhVn9mWB48Ioaq1lwo9JNIPBZVmkPxHQLkninbhxhygnGg1CbUT oGW17Ux4MBINO4dmgKbu+Utp2VHQPeK9ekRkhbqKRmi394MCCYKhlWUKOKKNkW2OCvm/ C/oQeqGtJpYSGE2l25Dn9HmMZ2y/anCWlwpp0zuAMHVCbHj1SKmyDVtoy+V+GDvYAf31 XxLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695004433; x=1695609233; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nTmir5rn3UlIrKR7p15dZ7vWzRExoEUjiRCPzxjaJGs=; b=BJpfm1K26kci4g2ebOZJ/LsrHoBSZ5MSDM/AXHugJ1c4ZdI9AbIJp0szwJBn77n+fF UGUrThPJBaB0sD/VyB7NL9y5sbbSK4XvQtD4E6K+ZTuq+8bUMSnEPWqEtWWDvBuCV/w9 q9iT2sDV4iMAIgZM/URR0yhW/trPHT6DUsrPS9ATLM7xgotJSWIB8MZg31h7aqG0Okuk IymBHVlC0JvvAczO80rp3P9KWA5Du0Hixj28AC0z/EqWdODB5MtngIyh2B2JQSyskr1b M4xBU1oTUxlZv1wu5cpbmdGs84CCThpYhdYcftpim8hXIrnj4iXz+BeiFMMMlih2EVuz 3pkQ== X-Gm-Message-State: AOJu0YzGg3meXSliwJ3ypbNWixxuIqCI7+ZBM+Bdza81qLLSMVYlTBV6 ipNnyAv6e0HrgJTjRfkNdyYhTA== X-Google-Smtp-Source: AGHT+IF0TrlBQ0CqUF0o+TWzvgqf2tyerKosLxEI2PCs/FiKXfsR9sVR5yI+/g18VLJ1ygncKfGqNQ== X-Received: by 2002:a17:902:7202:b0:1c0:7e86:4f6 with SMTP id ba2-20020a170902720200b001c07e8604f6mr7942216plb.14.1695004432682; Sun, 17 Sep 2023 19:33:52 -0700 (PDT) Received: from hermes.local (204-195-112-131.wavecable.com. [204.195.112.131]) by smtp.gmail.com with ESMTPSA id l7-20020a170902f68700b001bda30ecaa6sm7250374plg.51.2023.09.17.19.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 19:33:52 -0700 (PDT) Date: Sun, 17 Sep 2023 19:33:50 -0700 From: Stephen Hemminger To: Cc: , , Steven Song Subject: Re: [PATCH v5 08/32] net/sssnic/base: add work queue Message-ID: <20230917193350.5f56284d@hermes.local> In-Reply-To: <20230904045658.238185-9-wanry@3snic.com> References: <20230904045658.238185-1-wanry@3snic.com> <20230904045658.238185-9-wanry@3snic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Mon, 4 Sep 2023 12:56:34 +0800 wrote: > +void * > +sssnic_workq_consume(struct sssnic_workq *workq, uint16_t num_entries, > + uint16_t *ci) > +{ > + void *e; > + uint16_t current_ci; > + > + if (workq->idle_entries + num_entries > workq->num_entries) > + return NULL; > + > + current_ci = sssnic_workq_ci_get(workq); > + e = (void *)sssnic_workq_entry_get(workq, current_ci); Minor nit: cast to void * is not normally necessary in C. Compiler will do it for you.