From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles (Chas) Williams" <3chas3@gmail.com> Subject: Re: [PATCH] bnx2x: set Ethernet address type during transmit for VF's Date: Mon, 07 Dec 2015 06:01:57 -0500 Message-ID: <1449486117.2645.73.camel@gmail.com> References: <1447880321-16187-1-git-send-email-3chas3@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" To: Harish Patil Return-path: Received: from mail-qk0-f176.google.com (mail-qk0-f176.google.com [209.85.220.176]) by dpdk.org (Postfix) with ESMTP id 8AE7E95A1 for ; Mon, 7 Dec 2015 12:01:59 +0100 (CET) Received: by qkfb125 with SMTP id b125so1009494qkf.2 for ; Mon, 07 Dec 2015 03:01:59 -0800 (PST) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Sun, 2015-12-06 at 23:34 +0000, Harish Patil wrote: > > > >The original was always setting unicast. While here, clean up some > >other references that also point into the Ethernet header. > > > >Signed-off-by: Chas Williams <3chas3@gmail.com> > >--- > > drivers/net/bnx2x/bnx2x.c | 23 +++++++++++++++-------- > > drivers/net/bnx2x/ecore_hsi.h | 5 +++-- > > 2 files changed, 18 insertions(+), 10 deletions(-) > > > >diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c > >index 76444eb..294711f 100644 > >--- a/drivers/net/bnx2x/bnx2x.c > >+++ b/drivers/net/bnx2x/bnx2x.c > >@@ -2177,25 +2177,32 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, > >struct rte_mbuf **m_head, int m_p > > bd_prod = NEXT_TX_BD(bd_prod); > > if (IS_VF(sc)) { > > struct eth_tx_parse_bd_e2 *tx_parse_bd; > >- uint8_t *data = rte_pktmbuf_mtod(m0, uint8_t *); > >+ const struct ether_hdr *eh = rte_pktmbuf_mtod(m0, struct ether_hdr *); > >+ uint8_t mac_type = UNICAST_ADDRESS; > > > > tx_parse_bd = > > &txq->tx_ring[TX_BD(bd_prod, txq)].parse_bd_e2; > >+ if (is_multicast_ether_addr(&eh->d_addr)) { > > Minor comment. unlikely() may be used here to keep it consistent with base > driver. It wasn't clear to me that this code path is all that unlikely(). > >+ if (is_broadcast_ether_addr(&eh->d_addr)) > >+ mac_type = BROADCAST_ADDRESS; > >+ else > >+ mac_type = MULTICAST_ADDRESS; > >+ }