* [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function @ 2015-10-05 17:50 Adrien Mazarguil 2015-10-05 17:50 ` [dpdk-dev] [PATCH 2/3] mlx4: fill if_index field in dev_info structure Adrien Mazarguil ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Adrien Mazarguil @ 2015-10-05 17:50 UTC (permalink / raw) To: dev They were dropped by mistake in the commit below. Fixes: ab351fe1c95c ("mbuf: remove packet type from offload flags") Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> --- drivers/net/mlx4/mlx4.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 2f49ed5..e1ca577 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -2735,6 +2735,7 @@ mlx4_rx_burst_sp(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) PORT(pkt_buf) = rxq->port_id; PKT_LEN(pkt_buf) = pkt_buf_len; pkt_buf->packet_type = rxq_cq_to_pkt_type(flags); + pkt_buf->ol_flags = rxq_cq_to_ol_flags(rxq, flags); /* Return packet. */ *(pkts++) = pkt_buf; -- 2.1.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/3] mlx4: fill if_index field in dev_info structure 2015-10-05 17:50 [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Adrien Mazarguil @ 2015-10-05 17:50 ` Adrien Mazarguil 2015-10-05 17:50 ` [dpdk-dev] [PATCH 3/3] mlx4: do not expose broadcast address in MAC list Adrien Mazarguil 2015-10-20 19:59 ` [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Thomas Monjalon 2 siblings, 0 replies; 4+ messages in thread From: Adrien Mazarguil @ 2015-10-05 17:50 UTC (permalink / raw) To: dev; +Cc: Francesco Santoro From: Francesco Santoro <francesco.santoro@6wind.com> Allows applications to retrieve the name of the related netdevice. Signed-off-by: Francesco Santoro <francesco.santoro@6wind.com> --- drivers/net/mlx4/mlx4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index e1ca577..9614471 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -3819,6 +3819,7 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) { struct priv *priv = dev->data->dev_private; unsigned int max; + char ifname[IF_NAMESIZE]; priv_lock(priv); /* FIXME: we should ask the device for these values. */ @@ -3848,6 +3849,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM) : 0); + if (priv_get_ifname(priv, &ifname) == 0) + info->if_index = if_nametoindex(ifname); priv_unlock(priv); } -- 2.1.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 3/3] mlx4: do not expose broadcast address in MAC list 2015-10-05 17:50 [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Adrien Mazarguil 2015-10-05 17:50 ` [dpdk-dev] [PATCH 2/3] mlx4: fill if_index field in dev_info structure Adrien Mazarguil @ 2015-10-05 17:50 ` Adrien Mazarguil 2015-10-20 19:59 ` [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Thomas Monjalon 2 siblings, 0 replies; 4+ messages in thread From: Adrien Mazarguil @ 2015-10-05 17:50 UTC (permalink / raw) To: dev From: Didier Pallard <didier.pallard@6wind.com> Use the last array entry to store the broadcast address and keep it hidden by not reporting the entire array size. This is done to prevent DPDK applications from attempting to modify or remove it. Signed-off-by: Didier Pallard <didier.pallard@6wind.com> --- drivers/net/mlx4/mlx4.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 9614471..af31573 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -3836,7 +3836,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) max = 65535; info->max_rx_queues = max; info->max_tx_queues = max; - info->max_mac_addrs = elemof(priv->mac); + /* Last array entry is reserved for broadcast. */ + info->max_mac_addrs = (elemof(priv->mac) - 1); info->rx_offload_capa = (priv->hw_csum ? (DEV_RX_OFFLOAD_IPV4_CKSUM | @@ -3969,11 +3970,8 @@ mlx4_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) priv_lock(priv); DEBUG("%p: removing MAC address from index %" PRIu32, (void *)dev, index); - if (index >= MLX4_MAX_MAC_ADDRESSES) - goto end; - /* Refuse to remove the broadcast address, this one is special. */ - if (!memcmp(priv->mac[index].addr_bytes, "\xff\xff\xff\xff\xff\xff", - ETHER_ADDR_LEN)) + /* Last array entry is reserved for broadcast. */ + if (index >= (elemof(priv->mac) - 1)) goto end; priv_mac_addr_del(priv, index); end: @@ -4002,11 +4000,8 @@ mlx4_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, priv_lock(priv); DEBUG("%p: adding MAC address at index %" PRIu32, (void *)dev, index); - if (index >= MLX4_MAX_MAC_ADDRESSES) - goto end; - /* Refuse to add the broadcast address, this one is special. */ - if (!memcmp(mac_addr->addr_bytes, "\xff\xff\xff\xff\xff\xff", - ETHER_ADDR_LEN)) + /* Last array entry is reserved for broadcast. */ + if (index >= (elemof(priv->mac) - 1)) goto end; priv_mac_addr_add(priv, index, (const uint8_t (*)[ETHER_ADDR_LEN]) @@ -4943,7 +4938,7 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) claim_zero(priv_mac_addr_add(priv, 0, (const uint8_t (*)[ETHER_ADDR_LEN]) mac.addr_bytes)); - claim_zero(priv_mac_addr_add(priv, 1, + claim_zero(priv_mac_addr_add(priv, (elemof(priv->mac) - 1), &(const uint8_t [ETHER_ADDR_LEN]) { "\xff\xff\xff\xff\xff\xff" })); #ifndef NDEBUG -- 2.1.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function 2015-10-05 17:50 [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Adrien Mazarguil 2015-10-05 17:50 ` [dpdk-dev] [PATCH 2/3] mlx4: fill if_index field in dev_info structure Adrien Mazarguil 2015-10-05 17:50 ` [dpdk-dev] [PATCH 3/3] mlx4: do not expose broadcast address in MAC list Adrien Mazarguil @ 2015-10-20 19:59 ` Thomas Monjalon 2 siblings, 0 replies; 4+ messages in thread From: Thomas Monjalon @ 2015-10-20 19:59 UTC (permalink / raw) To: Adrien Mazarguil; +Cc: dev 2015-10-05 19:50, Adrien Mazarguil: > They were dropped by mistake in the commit below. > > Fixes: ab351fe1c95c ("mbuf: remove packet type from offload flags") > > Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Series applied, thanks ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-20 20:00 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-10-05 17:50 [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Adrien Mazarguil 2015-10-05 17:50 ` [dpdk-dev] [PATCH 2/3] mlx4: fill if_index field in dev_info structure Adrien Mazarguil 2015-10-05 17:50 ` [dpdk-dev] [PATCH 3/3] mlx4: do not expose broadcast address in MAC list Adrien Mazarguil 2015-10-20 19:59 ` [dpdk-dev] [PATCH 1/3] mlx4: fix missing ol_flags in scattered RX function Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).