All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harish Patil <harish.patil@qlogic.com>
To: Chas Williams <3chas3@gmail.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH] bnx2x: set Ethernet address type during transmit for VF's
Date: Sun, 6 Dec 2015 23:34:11 +0000	[thread overview]
Message-ID: <D289FA81.1090FE%harish.patil@qlogic.com> (raw)
In-Reply-To: <1447880321-16187-1-git-send-email-3chas3@gmail.com>

>
>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.

>+                              if (is_broadcast_ether_addr(&eh->d_addr))
>+                                      mac_type = BROADCAST_ADDRESS;
>+                              else
>+                                      mac_type = MULTICAST_ADDRESS;
>+                      }
>                       tx_parse_bd->parsing_data =
>-                          (1 << ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT);
>+                          (mac_type << ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT);
>
>                       rte_memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
>-                                 &data[0], 2);
>+                                 &eh->d_addr.addr_bytes[0], 2);
>                       rte_memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
>-                                 &data[2], 2);
>+                                 &eh->d_addr.addr_bytes[2], 2);
>                       rte_memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
>-                                 &data[4], 2);
>+                                 &eh->d_addr.addr_bytes[4], 2);
>                       rte_memcpy(&tx_parse_bd->data.mac_addr.src_hi,
>-                                 &data[6], 2);
>+                                 &eh->s_addr.addr_bytes[0], 2);
>                       rte_memcpy(&tx_parse_bd->data.mac_addr.src_mid,
>-                                 &data[8], 2);
>+                                 &eh->s_addr.addr_bytes[2], 2);
>                       rte_memcpy(&tx_parse_bd->data.mac_addr.src_lo,
>-                                 &data[10], 2);
>+                                 &eh->s_addr.addr_bytes[4], 2);
>
>                       tx_parse_bd->data.mac_addr.dst_hi =
>                           rte_cpu_to_be_16(tx_parse_bd->data.mac_addr.dst_hi);
>diff --git a/drivers/net/bnx2x/ecore_hsi.h b/drivers/net/bnx2x/ecore_hsi.h
>index a4ed9b5..6c11c5a 100644
>--- a/drivers/net/bnx2x/ecore_hsi.h
>+++ b/drivers/net/bnx2x/ecore_hsi.h
>@@ -4029,7 +4029,7 @@ struct double_regpair
>
>
> /*
>- * Ethernet address typesm used in ethernet tx BDs
>+ * Ethernet address types used in ethernet tx BDs
>  */
> enum eth_addr_type
> {
>@@ -4037,7 +4037,8 @@ enum eth_addr_type
>       UNICAST_ADDRESS,
>       MULTICAST_ADDRESS,
>       BROADCAST_ADDRESS,
>-      MAX_ETH_ADDR_TYPE};
>+      MAX_ETH_ADDR_TYPE
>+};
>
>
> /*
>--
>2.1.0
>
>

Acked-by: Harish Patil <harish.patil@qlogic.com>


Thanks,
Harish


________________________________

This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

  parent reply	other threads:[~2015-12-06 23:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 20:58 [PATCH] bnx2x: set Ethernet address type during transmit for VF's Chas Williams
2015-12-06 22:20 ` Thomas Monjalon
2015-12-06 22:22   ` Thomas Monjalon
2015-12-06 23:34 ` Harish Patil [this message]
2015-12-07 11:01   ` Charles (Chas) Williams
2015-12-07 17:29     ` Harish Patil
2015-12-08 14:27       ` Charles (Chas) Williams
2015-12-08 21:38         ` Bruce Richardson
2015-12-08 21:48           ` Harish Patil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D289FA81.1090FE%harish.patil@qlogic.com \
    --to=harish.patil@qlogic.com \
    --cc=3chas3@gmail.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.