From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 055DD1D7 for ; Fri, 5 Jan 2018 18:57:18 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jan 2018 09:57:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,319,1511856000"; d="scan'208";a="19310971" Received: from debian-xvivbkq.sh.intel.com ([10.67.104.226]) by fmsmga001.fm.intel.com with ESMTP; 05 Jan 2018 09:57:16 -0800 Date: Sat, 6 Jan 2018 01:56:49 +0800 From: Tiwei Bie To: Xiao Wang Cc: dev@dpdk.org, yliu@fridaylinux.org, stephen@networkplumber.org Message-ID: <20180105175649.cytuiz243nlemiwj@debian-xvivbkq.sh.intel.com> References: <1515081578-30649-3-git-send-email-xiao.w.wang@intel.com> <1515170817-136539-1-git-send-email-xiao.w.wang@intel.com> <1515170817-136539-4-git-send-email-xiao.w.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1515170817-136539-4-git-send-email-xiao.w.wang@intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Subject: Re: [dpdk-dev] [PATCH v5 3/3] net/virtio: support GUEST ANNOUNCE 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: , X-List-Received-Date: Fri, 05 Jan 2018 17:57:19 -0000 On Fri, Jan 05, 2018 at 08:46:57AM -0800, Xiao Wang wrote: [...] > +static int > +make_rarp_packet(struct rte_mbuf *rarp_mbuf, const struct ether_addr *mac) > +{ > + struct ether_hdr *eth_hdr; > + struct arp_hdr *rarp; Please just use one space between the type and var instead of two. > + [...] > +static void > +virtio_notify_peers(struct rte_eth_dev *dev) > +{ > + struct virtio_hw *hw = dev->data->dev_private; > + struct virtnet_rx *rxvq = dev->data->rx_queues[0]; > + struct rte_mbuf *rarp_mbuf; > + > + rarp_mbuf = rte_mbuf_raw_alloc(rxvq->mpool); It's not necessary to use rte_mbuf_raw_alloc() here and you forgot to initialize the allocated mbuf. I think you can use rte_pktmbuf_alloc() directly as what I showed in the example in my previous mail. > + if (rarp_mbuf == NULL) { > + PMD_DRV_LOG(ERR, "first mbuf allocate free_bufed"); Typos: first? free_bufed? > + return; > + } [...] > +static void > +virtio_ack_link_announce(struct rte_eth_dev *dev) > +{ > + struct virtio_hw *hw = dev->data->dev_private; > + struct virtio_pmd_ctrl ctrl; > + int len; > + > + ctrl.hdr.class = VIRTIO_NET_CTRL_ANNOUNCE; > + ctrl.hdr.cmd = VIRTIO_NET_CTRL_ANNOUNCE_ACK; > + len = 0; > + > + virtio_send_command(hw->cvq, &ctrl, &len, 0); If the last param is 0, then the third param could be NULL, i.e. you don't need to define `len`. > +} > + [...] > diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h > index 4a2a2f0..04b6a37 100644 > --- a/drivers/net/virtio/virtio_ethdev.h > +++ b/drivers/net/virtio/virtio_ethdev.h > @@ -68,6 +68,7 @@ > 1u << VIRTIO_NET_F_HOST_TSO6 | \ > 1u << VIRTIO_NET_F_MRG_RXBUF | \ > 1u << VIRTIO_NET_F_MTU | \ > + 1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE | \ Please use one space before '|' instead of two. Thanks, Tiwei