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 6B0F045EFE; Sat, 21 Dec 2024 01:51:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9FB540156; Sat, 21 Dec 2024 01:51:28 +0100 (CET) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 6F0C64003C for ; Sat, 21 Dec 2024 01:51:27 +0100 (CET) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-21680814d42so22967195ad.2 for ; Fri, 20 Dec 2024 16:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734742286; x=1735347086; 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=4Q1Tvp/Zi9sglb74a3zF91HkGR6tQbBX/uo2OlYll6U=; b=I81s3OE6i8efbx9iKFsdnf5H7wWWe+/BwthdF7w0B+j8+TO2yMmpOrvUwEGfyTaM/l 8MPND7yQkmopsdQTF0ktxVzaEFO68XELAFVaJ3e+a8LrbJr3dZjtOpiloI2MqA+6PilH sefYpowsUq7A7lmdmkLiuaZsuUmXGOYBvZgVyJFXeTyqgHkR8hYsc2f/P6dcFPcjYgyV PMlAoTOH+xgarZXSmheUXXCu/tuLZ9XlknUlbX0t702q++yIdzV9IuxifgHKKO4Sx6Uw odRhjD5sRv+eEL3NGNXXQ8e6aYV1MQVHEAu1mDdC9Y2gZNO7n5UYC3xpezwYKXyL5kzB VO1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734742286; x=1735347086; 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=4Q1Tvp/Zi9sglb74a3zF91HkGR6tQbBX/uo2OlYll6U=; b=dkNq5mxPZ1bKOWoTu4+nnyy3farcfqsxCwjhZBvbpCd+HPlyEzt051p8hzg665yerw EtcHvhGqPS9kqHcboNskuJ0tGE+7G1eGMjTcjOsASrNxQ2dCAoOvnOuoIhsxnFMD34tT jsFPFixbsViEhSifATbsDb+2p5s5AtEpUDeP6UQdp/4jcy8mLUdhyeKQMFW+NAWyaMIL tNB1zyGTSs6Qa51onie0YK72cgDhb4U4dkmXrOD6Hh+wpS3AUse3cV9DAZ23XcXzm82Z uuP53DwQYdsdZrdlarOwZCuxBF0Gdv/gahWY/8sPZb5aJyBAKyBi3e2VGaVaSMPmoFXo LjxQ== X-Gm-Message-State: AOJu0YyoxE3FeH5ENEcO4JD3chnuH4483AsTJwi2FNanpHxgEIjIUBN+ VR2ffFFHcr06VMI6rIhkNALxAxzShWfisyZPl8LlIo05Xuo+orFGqe0ATuTgBac= X-Gm-Gg: ASbGnct9YRbwtdVfYLsGrjzPPNQ4t9nFaNr6e5qBfox2cBFDR+9en4u+BsHnWU1Xc5k jOgkrO0AjD6oG6+E7IQi5kp2i7kwd7ipVrEjqKP+PoxpZ9TYej5VbLdfqxRtXxhpRDTUiaPyTIV NybtTz5S+QaNw3TxqU0ujFiWAkdUG+gyyRpp3/GC3eRVomJuUh+Rdytf/sgYOnsghFaJa6Q0nk5 8um1ZKCMQkp8HK6jD5bREILA3fmDWyOy9xsF4DwtPAQafIpAnRfJztoXUuZZ4C6EYdMs0UQi6z2 zws7ByzhT2agQFN3tfHAXjge7uKnWLtdjQ== X-Google-Smtp-Source: AGHT+IFn1Gm5C7hVvH/JmbmuP3pEaw8QIseGLj2dcEYY7dj36OyOIPTbC653k+ib+vaDPIWnKJi6Kw== X-Received: by 2002:a17:903:2384:b0:216:5cbd:5449 with SMTP id d9443c01a7336-219e6e9e8c5mr67227825ad.13.1734742286560; Fri, 20 Dec 2024 16:51:26 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9f738asm34180105ad.205.2024.12.20.16.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 16:51:26 -0800 (PST) Date: Fri, 20 Dec 2024 16:51:24 -0800 From: Stephen Hemminger To: Junlong Wang Cc: dev@dpdk.org Subject: Re: [PATCH v4 06/15] net/zxdh: dev start/stop ops implementations Message-ID: <20241220165124.04bf045f@hermes.local> In-Reply-To: <20241218092603.1218855-7-wang.junlong1@zte.com.cn> References: <20241210055333.782901-2-wang.junlong1@zte.com.cn> <20241218092603.1218855-1-wang.junlong1@zte.com.cn> <20241218092603.1218855-7-wang.junlong1@zte.com.cn> 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 Wed, 18 Dec 2024 17:25:53 +0800 Junlong Wang wrote: > +static void > +zxdh_notify_queue(struct zxdh_hw *hw, struct zxdh_virtqueue *vq) > +{ > + uint32_t notify_data = 0; > + > + if (!zxdh_pci_with_feature(hw, ZXDH_F_NOTIFICATION_DATA)) { > + rte_write16(vq->vq_queue_index, vq->notify_addr); > + return; > + } > + > + if (zxdh_pci_with_feature(hw, ZXDH_F_RING_PACKED)) { > + notify_data = ((uint32_t)(!!(vq->vq_packed.cached_flags & > + ZXDH_VRING_PACKED_DESC_F_AVAIL)) << 31) | > + ((uint32_t)vq->vq_avail_idx << 16) | > + vq->vq_queue_index; > + } else { > + notify_data = ((uint32_t)vq->vq_avail_idx << 16) | vq->vq_queue_index; > + } > + PMD_DRV_LOG(DEBUG, "queue:%d notify_data 0x%x notify_addr 0x%p", > + vq->vq_queue_index, notify_data, vq->notify_addr); > + rte_write32(notify_data, vq->notify_addr); > +} Looks like the notify_data part could be simplified to: notify_data = ((uint32_t)vq->vq_avail_idx << 16) | vq->vq_queue_index; if (zxdh_pci_with_feature(hw, ZXDH_F_RING_PACKED) && (vq->vq_packed.cached_flags & ZXDH_VRING_PACKED_DESC_F_AVAIL) notify_data |= RTE_BIT32(31);