* [PATCH 2/5] crypto: chtls: wait for memory sendmsg, sendpage
From: Atul Gupta @ 2018-05-14 11:00 UTC (permalink / raw)
To: herbert, linux-crypto; +Cc: gustavo, dan.carpenter, netdev, davem, atul.gupta
In-Reply-To: <1526295659-29839-1-git-send-email-atul.gupta@chelsio.com>
Reported-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
---
drivers/crypto/chelsio/chtls/chtls.h | 1 +
drivers/crypto/chelsio/chtls/chtls_io.c | 90 +++++++++++++++++++++++++++++--
drivers/crypto/chelsio/chtls/chtls_main.c | 1 +
3 files changed, 89 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/chelsio/chtls/chtls.h b/drivers/crypto/chelsio/chtls/chtls.h
index f4b8f1e..778c194 100644
--- a/drivers/crypto/chelsio/chtls/chtls.h
+++ b/drivers/crypto/chelsio/chtls/chtls.h
@@ -149,6 +149,7 @@ struct chtls_dev {
struct list_head rcu_node;
struct list_head na_node;
unsigned int send_page_order;
+ int max_host_sndbuf;
struct key_map kmap;
};
diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c
index 5a75be4..a4c7d2d 100644
--- a/drivers/crypto/chelsio/chtls/chtls_io.c
+++ b/drivers/crypto/chelsio/chtls/chtls_io.c
@@ -914,6 +914,78 @@ static u16 tls_header_read(struct tls_hdr *thdr, struct iov_iter *from)
return (__force u16)cpu_to_be16(thdr->length);
}
+static int csk_mem_free(struct chtls_dev *cdev, struct sock *sk)
+{
+ return (cdev->max_host_sndbuf - sk->sk_wmem_queued) > 0;
+}
+
+static int csk_wait_memory(struct chtls_dev *cdev,
+ struct sock *sk, long *timeo_p)
+{
+ DEFINE_WAIT_FUNC(wait, woken_wake_function);
+ int sndbuf, err = 0;
+ long current_timeo;
+ long vm_wait = 0;
+ bool noblock;
+
+ current_timeo = *timeo_p;
+ noblock = (*timeo_p ? false : true);
+ sndbuf = cdev->max_host_sndbuf;
+ if (sndbuf > sk->sk_wmem_queued) {
+ current_timeo = (prandom_u32() % (HZ / 5)) + 2;
+ vm_wait = (prandom_u32() % (HZ / 5)) + 2;
+ }
+
+ add_wait_queue(sk_sleep(sk), &wait);
+ while (1) {
+ sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
+
+ if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
+ goto do_error;
+ if (!*timeo_p) {
+ if (noblock)
+ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
+ goto do_nonblock;
+ }
+ if (signal_pending(current))
+ goto do_interrupted;
+ sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk);
+ if (sndbuf > sk->sk_wmem_queued && !vm_wait)
+ break;
+
+ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
+ sk->sk_write_pending++;
+ sk_wait_event(sk, ¤t_timeo, sk->sk_err ||
+ (sk->sk_shutdown & SEND_SHUTDOWN) ||
+ (sndbuf > sk->sk_wmem_queued && !vm_wait), &wait);
+ sk->sk_write_pending--;
+
+ if (vm_wait) {
+ vm_wait -= current_timeo;
+ current_timeo = *timeo_p;
+ if (current_timeo != MAX_SCHEDULE_TIMEOUT) {
+ current_timeo -= vm_wait;
+ if (current_timeo < 0)
+ current_timeo = 0;
+ }
+ vm_wait = 0;
+ }
+ *timeo_p = current_timeo;
+ }
+out:
+ remove_wait_queue(sk_sleep(sk), &wait);
+ return err;
+do_error:
+ err = -EPIPE;
+ goto out;
+do_nonblock:
+ err = -EAGAIN;
+ goto out;
+do_interrupted:
+ err = sock_intr_errno(*timeo_p);
+ goto out;
+}
+
int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
{
struct chtls_sock *csk = rcu_dereference_sk_user_data(sk);
@@ -952,6 +1024,8 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
copy = mss - skb->len;
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
+ if (!csk_mem_free(cdev, sk))
+ goto wait_for_sndbuf;
if (is_tls_tx(csk) && !csk->tlshws.txleft) {
struct tls_hdr hdr;
@@ -1099,8 +1173,10 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
if (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND)
push_frames_if_head(sk);
continue;
+wait_for_sndbuf:
+ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
wait_for_memory:
- err = sk_stream_wait_memory(sk, &timeo);
+ err = csk_wait_memory(cdev, sk, &timeo);
if (err)
goto do_error;
}
@@ -1131,6 +1207,7 @@ int chtls_sendpage(struct sock *sk, struct page *page,
int offset, size_t size, int flags)
{
struct chtls_sock *csk;
+ struct chtls_dev *cdev;
int mss, err, copied;
struct tcp_sock *tp;
long timeo;
@@ -1138,6 +1215,7 @@ int chtls_sendpage(struct sock *sk, struct page *page,
tp = tcp_sk(sk);
copied = 0;
csk = rcu_dereference_sk_user_data(sk);
+ cdev = csk->cdev;
timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
err = sk_stream_wait_connect(sk, &timeo);
@@ -1156,6 +1234,8 @@ int chtls_sendpage(struct sock *sk, struct page *page,
if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) ||
copy <= 0) {
new_buf:
+ if (!csk_mem_free(cdev, sk))
+ goto wait_for_sndbuf;
if (is_tls_tx(csk)) {
skb = get_record_skb(sk,
@@ -1167,7 +1247,7 @@ int chtls_sendpage(struct sock *sk, struct page *page,
skb = get_tx_skb(sk, 0);
}
if (!skb)
- goto do_error;
+ goto wait_for_memory;
copy = mss;
}
if (copy > size)
@@ -1206,8 +1286,12 @@ int chtls_sendpage(struct sock *sk, struct page *page,
if (unlikely(ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND))
push_frames_if_head(sk);
continue;
-
+wait_for_sndbuf:
set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
+wait_for_memory:
+ err = csk_wait_memory(cdev, sk, &timeo);
+ if (err)
+ goto do_error;
}
out:
csk_reset_flag(csk, CSK_TX_MORE_DATA);
diff --git a/drivers/crypto/chelsio/chtls/chtls_main.c b/drivers/crypto/chelsio/chtls/chtls_main.c
index 5b9dd58..e9ffc3d 100644
--- a/drivers/crypto/chelsio/chtls/chtls_main.c
+++ b/drivers/crypto/chelsio/chtls/chtls_main.c
@@ -238,6 +238,7 @@ static void *chtls_uld_add(const struct cxgb4_lld_info *info)
spin_lock_init(&cdev->idr_lock);
cdev->send_page_order = min_t(uint, get_order(32768),
send_page_order);
+ cdev->max_host_sndbuf = 48 * 1024;
if (lldi->vr->key.size)
if (chtls_init_kmap(cdev, lldi))
--
1.8.3.1
^ permalink raw reply related
* [PATCH 1/5] crypto:chtls: key len correction
From: Atul Gupta @ 2018-05-14 11:00 UTC (permalink / raw)
To: herbert, linux-crypto; +Cc: gustavo, dan.carpenter, netdev, davem, atul.gupta
In-Reply-To: <1526295659-29839-1-git-send-email-atul.gupta@chelsio.com>
corrected the key length to copy 128b key. Removed 192b and 256b
key as user input supports key of size 128b in gcm_ctx
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
---
drivers/crypto/chelsio/chtls/chtls_hw.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/crypto/chelsio/chtls/chtls_hw.c b/drivers/crypto/chelsio/chtls/chtls_hw.c
index 54a13aa9..55d5014 100644
--- a/drivers/crypto/chelsio/chtls/chtls_hw.c
+++ b/drivers/crypto/chelsio/chtls/chtls_hw.c
@@ -213,7 +213,7 @@ static int chtls_key_info(struct chtls_sock *csk,
struct _key_ctx *kctx,
u32 keylen, u32 optname)
{
- unsigned char key[CHCR_KEYCTX_CIPHER_KEY_SIZE_256];
+ unsigned char key[AES_KEYSIZE_128];
struct tls12_crypto_info_aes_gcm_128 *gcm_ctx;
unsigned char ghash_h[AEAD_H_SIZE];
struct crypto_cipher *cipher;
@@ -228,10 +228,6 @@ static int chtls_key_info(struct chtls_sock *csk,
if (keylen == AES_KEYSIZE_128) {
ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_128;
- } else if (keylen == AES_KEYSIZE_192) {
- ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_192;
- } else if (keylen == AES_KEYSIZE_256) {
- ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_256;
} else {
pr_err("GCM: Invalid key length %d\n", keylen);
return -EINVAL;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 0/5] build warnings cleanup
From: Atul Gupta @ 2018-05-14 11:00 UTC (permalink / raw)
To: herbert, linux-crypto; +Cc: gustavo, dan.carpenter, netdev, davem, atul.gupta
Build warnings cleanup reported for
- using only 128b key
- wait for buffer in sendmsg/sendpage
- check for null before using skb
- free rspq_skb_cache in error path
- indentation
Atul Gupta (5):
crypto:chtls: key len correction
crypto: chtls: wait for memory sendmsg, sendpage
crypto: chtls: dereference null variable
crypto: chtls: kbuild warnings
crypto: chtls: free beyond end rspq_skb_cache
drivers/crypto/chelsio/chtls/chtls.h | 1 +
drivers/crypto/chelsio/chtls/chtls_hw.c | 6 +-
drivers/crypto/chelsio/chtls/chtls_io.c | 104 +++++++++++++++++++++++++++---
drivers/crypto/chelsio/chtls/chtls_main.c | 3 +-
4 files changed, 98 insertions(+), 16 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [kbuild-all] [PATCH net-next 2/2] sctp: add sctp_make_op_error_limited and reuse inner functions
From: Marcelo Ricardo Leitner @ 2018-05-14 11:01 UTC (permalink / raw)
To: Ye Xiaolong
Cc: kbuild test robot, Xin Long, Neil Horman, netdev, Vlad Yasevich,
linux-sctp, kbuild-all
In-Reply-To: <20180514074053.GA21079@yexl-desktop>
On Mon, May 14, 2018 at 03:40:53PM +0800, Ye Xiaolong wrote:
> >> config: x86_64-randconfig-x006-201817 (attached as .config)
> >> compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
> >> reproduce:
> >> # save the attached .config to linux build tree
> >> make ARCH=x86_64
> >>
> >> All errors (new ones prefixed by >>):
> >>
> >> net//sctp/sm_make_chunk.c: In function 'sctp_make_op_error_limited':
> >> >> net//sctp/sm_make_chunk.c:1260:9: error: implicit declaration of function 'sctp_mtu_payload'; did you mean 'sctp_do_peeloff'? [-Werror=implicit-function-declaration]
> >> size = sctp_mtu_payload(sp, size, sizeof(struct sctp_errhdr));
> >> ^~~~~~~~~~~~~~~~
> >> sctp_do_peeloff
> >> cc1: some warnings being treated as errors
> >
> >Seems the test didn't pick up the MTU refactor patchset yet.
>
> Do you mean your patchset require MTU refactor patchset as prerequisites?
Yes.
Thanks,
Marcelo
^ permalink raw reply
* [PATCH net] cxgb4: Correct ntuple mask validation for hash filters
From: Ganesh Goudar @ 2018-05-14 10:57 UTC (permalink / raw)
To: netdev, davem
Cc: nirranjan, indranil, venkatesh, rahul.lakkireddy, Kumar Sanghvi,
Ganesh Goudar
From: Kumar Sanghvi <kumaras@chelsio.com>
Earlier code of doing bitwise AND with field width bits was wrong.
Instead, simplify code to calculate ntuple_mask based on supplied
fields and then compare with mask configured in hw - which is the
correct and simpler way to validate ntuple mask.
Fixes: 3eb8b62d5a26 ("cxgb4: add support to create hash-filters via tc-flower offload")
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 88 ++++++++---------------
1 file changed, 30 insertions(+), 58 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
index db92f18..b76447b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
@@ -836,7 +836,7 @@ bool is_filter_exact_match(struct adapter *adap,
{
struct tp_params *tp = &adap->params.tp;
u64 hash_filter_mask = tp->hash_filter_mask;
- u32 mask;
+ u64 ntuple_mask = 0;
if (!is_hashfilter(adap))
return false;
@@ -865,73 +865,45 @@ bool is_filter_exact_match(struct adapter *adap,
if (!fs->val.fport || fs->mask.fport != 0xffff)
return false;
- if (tp->fcoe_shift >= 0) {
- mask = (hash_filter_mask >> tp->fcoe_shift) & FT_FCOE_W;
- if (mask && !fs->mask.fcoe)
- return false;
- }
+ /* calculate tuple mask and compare with mask configured in hw */
+ if (tp->fcoe_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.fcoe << tp->fcoe_shift;
- if (tp->port_shift >= 0) {
- mask = (hash_filter_mask >> tp->port_shift) & FT_PORT_W;
- if (mask && !fs->mask.iport)
- return false;
- }
+ if (tp->port_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.iport << tp->port_shift;
if (tp->vnic_shift >= 0) {
- mask = (hash_filter_mask >> tp->vnic_shift) & FT_VNIC_ID_W;
-
- if ((adap->params.tp.ingress_config & VNIC_F)) {
- if (mask && !fs->mask.pfvf_vld)
- return false;
- } else {
- if (mask && !fs->mask.ovlan_vld)
- return false;
- }
+ if ((adap->params.tp.ingress_config & VNIC_F))
+ ntuple_mask |= (u64)fs->mask.pfvf_vld << tp->vnic_shift;
+ else
+ ntuple_mask |= (u64)fs->mask.ovlan_vld <<
+ tp->vnic_shift;
}
- if (tp->vlan_shift >= 0) {
- mask = (hash_filter_mask >> tp->vlan_shift) & FT_VLAN_W;
- if (mask && !fs->mask.ivlan)
- return false;
- }
+ if (tp->vlan_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.ivlan << tp->vlan_shift;
- if (tp->tos_shift >= 0) {
- mask = (hash_filter_mask >> tp->tos_shift) & FT_TOS_W;
- if (mask && !fs->mask.tos)
- return false;
- }
+ if (tp->tos_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.tos << tp->tos_shift;
- if (tp->protocol_shift >= 0) {
- mask = (hash_filter_mask >> tp->protocol_shift) & FT_PROTOCOL_W;
- if (mask && !fs->mask.proto)
- return false;
- }
+ if (tp->protocol_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.proto << tp->protocol_shift;
- if (tp->ethertype_shift >= 0) {
- mask = (hash_filter_mask >> tp->ethertype_shift) &
- FT_ETHERTYPE_W;
- if (mask && !fs->mask.ethtype)
- return false;
- }
+ if (tp->ethertype_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.ethtype << tp->ethertype_shift;
- if (tp->macmatch_shift >= 0) {
- mask = (hash_filter_mask >> tp->macmatch_shift) & FT_MACMATCH_W;
- if (mask && !fs->mask.macidx)
- return false;
- }
+ if (tp->macmatch_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.macidx << tp->macmatch_shift;
+
+ if (tp->matchtype_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.matchtype << tp->matchtype_shift;
+
+ if (tp->frag_shift >= 0)
+ ntuple_mask |= (u64)fs->mask.frag << tp->frag_shift;
+
+ if (ntuple_mask != hash_filter_mask)
+ return false;
- if (tp->matchtype_shift >= 0) {
- mask = (hash_filter_mask >> tp->matchtype_shift) &
- FT_MPSHITTYPE_W;
- if (mask && !fs->mask.matchtype)
- return false;
- }
- if (tp->frag_shift >= 0) {
- mask = (hash_filter_mask >> tp->frag_shift) &
- FT_FRAGMENTATION_W;
- if (mask && !fs->mask.frag)
- return false;
- }
return true;
}
--
2.1.0
^ permalink raw reply related
* Re: [PATCH bpf-next v2] samples/bpf: xdp_monitor, accept short options
From: Jesper Dangaard Brouer @ 2018-05-14 10:20 UTC (permalink / raw)
To: Prashant Bhole
Cc: Daniel Borkmann, Alexei Starovoitov, David S . Miller, netdev,
brouer
In-Reply-To: <20180514082915.3364-1-bhole_prashant_q7@lab.ntt.co.jp>
On Mon, 14 May 2018 17:29:15 +0900 Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> wrote:
> Updated optstring parameter for getopt_long() to accept short options.
> Also updated usage() function.
>
> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> ---
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH net-next] net: stmmac: Add Jose Abreu as co-maintainer
From: Sergei Shtylyov @ 2018-05-14 9:53 UTC (permalink / raw)
To: Jose Abreu, netdev
Cc: David S. Miller, Joao Pinto, Alexandre Torgue, Giuseppe Cavallaro
In-Reply-To: <06350075c76ee1c13f84c94346444507e9770ed2.1526290012.git.joabreu@synopsys.com>
Hello!
On 5/14/2018 12:29 PM, Jose Abreu wrote:
> I'm offering to be a co-maintainer for stmmac driver.
>
> As per discussion with Alexandre, I will arranje to get STM32 boards to
Arrange. :-)
> test patches in GMAC version 3.x and 4.1. I also have HW to test GMAC
> version 5.
>
> Looking forward to contribute to net-dev!
>
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Joao Pinto <jpinto@synopsys.com>
> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
[...]
MBR, Sergei
^ permalink raw reply
* Re: [PATCH v2] ipvlan: flush arp table when mac address changed
From: Sergei Shtylyov @ 2018-05-14 9:50 UTC (permalink / raw)
To: liuqifa, davem, dsahern, maheshb, weiyongjun1, maowenan,
dingtianhong
Cc: netdev, linux-kernel
In-Reply-To: <20180514092256.10940-1-liuqifa@huawei.com>
Hello.
On 5/14/2018 12:22 PM, liuqifa@huawei.com wrote:
> From: Keefe Liu <liuqifa@huawei.com>
>
> When master device's mac has been changed, the
> commit <32c10bbfe914> "ipvlan: always use the current L2
> addr of the master" makes the IPVlan devices's mac changed
commit 32c10bbfe914 ("ipvlan: always use the current L2
addr of the master").
> also, but it doesn't flush the IPVlan's arp table.
>
> Signed-off-by: Keefe Liu <liuqifa@huawei.com>
[...]
MBR, Sergei
^ permalink raw reply
* Re: [PATCH] net: phy: micrel: workaround for errata #2 for KSZ9031
From: Sergei Shtylyov @ 2018-05-14 9:42 UTC (permalink / raw)
To: Marco Felsch, robh+dt, mark.rutland, andrew, f.fainelli
Cc: netdev, devicetree, kernel, Markus Niebel
In-Reply-To: <20180514082218.29158-1-m.felsch@pengutronix.de>
On 5/14/2018 11:22 AM, Marco Felsch wrote:
> From: Markus Niebel <Markus.Niebel@tqs.de>
>
> handle errata #2 for KSZ9031: force 1000Base-T master
>
> Attention: enabling the workaround will cause no link to
> other GIGE master.
>
> Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
> [m.felsch@pengutronix.de: move dt binding to the KSZ9031 entry]
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> .../devicetree/bindings/net/micrel-ksz90x1.txt | 3 +++
> drivers/net/phy/micrel.c | 18 ++++++++++++++++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt b/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt
> index 42a248301615..e2465fbbbcef 100644
> --- a/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt
> +++ b/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt
> @@ -57,6 +57,9 @@ KSZ9031:
> - txd2-skew-ps : Skew control of TX data 2 pad
> - txd3-skew-ps : Skew control of TX data 3 pad
>
> + - force-master: Boolean, force phy to master mode. This is a
Not "micrel,force-master"?
> + workaround at least for KSZ9031 errata #2.
> +
> Examples:
>
> mdio {
[...]
MBR, Sergei
^ permalink raw reply
* Greetings
From: Ms Sophie Gabrielle @ 2018-05-14 9:42 UTC (permalink / raw)
My sincere greetings,
My Name is Ms Sophie Gabrielle, 19 years old single girl, the only child
and daughter of late Mr & Mrs Edward Anthony a Togolese by origin,
presently i am writing to you from Togo the capital of Togo. I was
impressed when i saw your contact. i have 5.5 million US dollars which
i inherited, i will like you to assist me in the claim and transfer of
the money into your bank account and as well establish a long lasting
investment partnership with you. Can you contact me back? Waiting to
hear from you soonest.
With love.
Ms Sophie Gabrielle
^ permalink raw reply
* Re: [PATCH] net: phy: micrel: workaround for errata #2 for KSZ9031
From: Sergei Shtylyov @ 2018-05-14 9:41 UTC (permalink / raw)
To: Marco Felsch, robh+dt, mark.rutland, andrew, f.fainelli
Cc: netdev, devicetree, kernel, Markus Niebel
In-Reply-To: <20180514082218.29158-1-m.felsch@pengutronix.de>
Hello!
On 5/14/2018 11:22 AM, Marco Felsch wrote:
> From: Markus Niebel <Markus.Niebel@tqs.de>
>
> handle errata #2 for KSZ9031: force 1000Base-T master
>
> Attention: enabling the workaround will cause no link to
> other GIGE master.
>
> Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
> [m.felsch@pengutronix.de: move dt binding to the KSZ9031 entry]
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
[...]
> @@ -573,6 +575,22 @@ static int ksz9031_config_init(struct phy_device *phydev)
> ksz9031_of_load_skew_values(phydev, of_node,
> MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,
> tx_data_skews, 4);
> +
> + /* force master mode -> errata #2
> + * attention: Master <-> Master will not work
> + */
> + if (of_property_read_bool(of_node, "force-master")) {
> + rc = phy_read(phydev, MII_CTRL1000);
> + if (rc >= 0) {
> + val = (u16)rc;
> + /* enable master mode, config &
> + * prefer master
> + */
> + val |= (CTL1000_ENABLE_MASTER |
> + CTL1000_AS_MASTER);
Parens not needed.
> + phy_write(phydev, MII_CTRL1000, val);
> + }
> + }
> }
>
> return ksz9031_center_flp_timing(phydev);
>
MBR, Sergei
^ permalink raw reply
* Re: [PATCH net-next] net: stmmac: Add Jose Abreu as co-maintainer
From: Alexandre Torgue @ 2018-05-14 9:36 UTC (permalink / raw)
To: Jose Abreu, netdev; +Cc: David S. Miller, Joao Pinto, Giuseppe Cavallaro
In-Reply-To: <06350075c76ee1c13f84c94346444507e9770ed2.1526290012.git.joabreu@synopsys.com>
On 05/14/2018 11:29 AM, Jose Abreu wrote:
> I'm offering to be a co-maintainer for stmmac driver.
>
> As per discussion with Alexandre, I will arranje to get STM32 boards to
> test patches in GMAC version 3.x and 4.1. I also have HW to test GMAC
> version 5.
>
> Looking forward to contribute to net-dev!
>
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Joao Pinto <jpinto@synopsys.com>
> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> ---
> MAINTAINERS | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index cecf461..c6989d0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -13385,6 +13385,7 @@ F: drivers/media/usb/stk1160/
> STMMAC ETHERNET DRIVER
> M: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> M: Alexandre Torgue <alexandre.torgue@st.com>
> +M: Jose Abreu <joabreu@synopsys.com>
> L: netdev@vger.kernel.org
> W: http://www.stlinux.com
> S: Supported
>
Thanks for this proposition.
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>
^ permalink raw reply
* [PATCH net-next] net: stmmac: Add Jose Abreu as co-maintainer
From: Jose Abreu @ 2018-05-14 9:29 UTC (permalink / raw)
To: netdev
Cc: Jose Abreu, David S. Miller, Joao Pinto, Alexandre Torgue,
Giuseppe Cavallaro
I'm offering to be a co-maintainer for stmmac driver.
As per discussion with Alexandre, I will arranje to get STM32 boards to
test patches in GMAC version 3.x and 4.1. I also have HW to test GMAC
version 5.
Looking forward to contribute to net-dev!
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
MAINTAINERS | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index cecf461..c6989d0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13385,6 +13385,7 @@ F: drivers/media/usb/stk1160/
STMMAC ETHERNET DRIVER
M: Giuseppe Cavallaro <peppe.cavallaro@st.com>
M: Alexandre Torgue <alexandre.torgue@st.com>
+M: Jose Abreu <joabreu@synopsys.com>
L: netdev@vger.kernel.org
W: http://www.stlinux.com
S: Supported
--
1.7.1
^ permalink raw reply related
* Re: [PATCH net-next v2 02/13] net: phy: sfp: handle non-wired SFP connectors
From: Antoine Tenart @ 2018-05-14 9:26 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Antoine Tenart, davem, kishon, gregory.clement, andrew, jason,
sebastian.hesselbarth, netdev, linux-kernel, thomas.petazzoni,
maxime.chevallier, miquel.raynal, nadavh, stefanc, ymarkman, mw,
linux-arm-kernel
In-Reply-To: <20180508115247.GF16141@n2100.armlinux.org.uk>
Hi Russell,
On Tue, May 08, 2018 at 12:52:47PM +0100, Russell King - ARM Linux wrote:
> On Fri, May 04, 2018 at 03:56:32PM +0200, Antoine Tenart wrote:
> > SFP connectors can be solder on a board without having any of their pins
> > (LOS, i2c...) wired. In such cases the SFP link state cannot be guessed,
> > and the overall link status reporting is left to other layers.
> >
> > In order to achieve this, a new SFP_DEV status is added, named UNKNOWN.
> > This mode is set when it is not possible for the SFP code to get the
> > link status and as a result the link status is reported to be always UP
> > from the SFP point of view.
>
> This looks weird to me. SFP_DEV_* states track the netdevice up/down
> state and have little to do with whether LOS or MODDEF0 are implemented.
That's right.
> I think it would be better to have a new SFP_MOD_* and to force
> sm_mod_state to that in this circumstance.
The idea was to avoid depending on the state machine, as this could be
difficult to maintain in the future (it's hard to tell exactly what are
all the possible paths). But I get your point about SFP_DEV_.
I can have a look at adding a new SFP_MOD_, or I could add a broken flag
into 'struct sfp', although having a SFP_MOD_ would be proper.
Before doing so, we should decide whether or not this approach is valid,
as there were comments from Florian and Andrew asking for a fixed-link
solution. I think fixed-link wouldn't be perfect from the user point of
view, but I understand the point. If we go with fixed-link, then this
patch can be dropped (the two others net: sfp: patches could be kept).
What do you think?
Thanks,
Antoine
--
Antoine Ténart, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply
* [PATCH v2] ipvlan: flush arp table when mac address changed
From: liuqifa @ 2018-05-14 9:22 UTC (permalink / raw)
To: davem, dsahern, maheshb, weiyongjun1, maowenan, dingtianhong,
liuqifa
Cc: netdev, linux-kernel
From: Keefe Liu <liuqifa@huawei.com>
When master device's mac has been changed, the
commit <32c10bbfe914> "ipvlan: always use the current L2
addr of the master" makes the IPVlan devices's mac changed
also, but it doesn't flush the IPVlan's arp table.
Signed-off-by: Keefe Liu <liuqifa@huawei.com>
---
drivers/net/ipvlan/ipvlan_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 450eec2..4377c26 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -792,8 +792,10 @@ static int ipvlan_device_event(struct notifier_block *unused,
break;
case NETDEV_CHANGEADDR:
- list_for_each_entry(ipvlan, &port->ipvlans, pnode)
+ list_for_each_entry(ipvlan, &port->ipvlans, pnode) {
ether_addr_copy(ipvlan->dev->dev_addr, dev->dev_addr);
+ call_netdevice_notifiers(NETDEV_CHANGEADDR, ipvlan->dev);
+ }
break;
case NETDEV_PRE_TYPE_CHANGE:
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH v2] net/mlx4_core: Fix error handling in mlx4_init_port_info.
From: Tariq Toukan @ 2018-05-14 9:08 UTC (permalink / raw)
To: Tarick Bedeir, tariqt, gthelen, netdev, linux-rdma, linux-kernel,
David Miller
In-Reply-To: <20180513233845.135290-1-tarick@google.com>
On 14/05/2018 2:38 AM, Tarick Bedeir wrote:
> Avoid exiting the function with a lingering sysfs file (if the first
> call to device_create_file() fails while the second succeeds), and avoid
> calling devlink_port_unregister() twice.
>
> In other words, either mlx4_init_port_info() succeeds and returns zero, or
> it fails, returns non-zero, and requires no cleanup.
>
> Fixes: 096335b3f983 ("mlx4_core: Allow dynamic MTU configuration for IB
> ports")
> Signed-off-by: Tarick Bedeir <tarick@google.com>
> ---
> v1 -> v2: Added "Fixes" tag.
> ---
> drivers/net/ethernet/mellanox/mlx4/main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index 4d84cab77105..e8a3a45d0b53 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -3007,6 +3007,7 @@ static int mlx4_init_port_info(struct mlx4_dev *dev, int port)
> mlx4_err(dev, "Failed to create file for port %d\n", port);
> devlink_port_unregister(&info->devlink_port);
> info->port = -1;
> + return err;
> }
>
> sprintf(info->dev_mtu_name, "mlx4_port%d_mtu", port);
> @@ -3028,9 +3029,10 @@ static int mlx4_init_port_info(struct mlx4_dev *dev, int port)
> &info->port_attr);
> devlink_port_unregister(&info->devlink_port);
> info->port = -1;
> + return err;
> }
>
> - return err;
> + return 0;
> }
>
> static void mlx4_cleanup_port_info(struct mlx4_port_info *info)
>
Thanks for you patch.
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Dave, please queue for -stable.
Best,
Tariq
^ permalink raw reply
* Re: [PATCH net-next v9 1/7] sched: Add Common Applications Kept Enhanced (cake) qdisc
From: Toke Høiland-Jørgensen @ 2018-05-14 9:08 UTC (permalink / raw)
To: David Miller; +Cc: netdev, cake
In-Reply-To: <20180513.200948.1658763899383204062.davem@davemloft.net>
David Miller <davem@davemloft.net> writes:
> From: Toke Høiland-Jørgensen <toke@toke.dk>
> Date: Tue, 08 May 2018 16:34:19 +0200
>
>> +struct cake_flow {
>> + /* this stuff is all needed per-flow at dequeue time */
>> + struct sk_buff *head;
>> + struct sk_buff *tail;
>
> Please do not invent your own SKB list handling mechanism.
We didn't invent it, we inherited it from fq_codel. I was actually about
to fix that, but then I noticed it was still around in fq_codel, and so
let it be. I can certainly fix it anyway, but, erm, why is it acceptable
in fq_codel but not in cake? struct sk_buff_head is not that new, is it?
>> +static void cake_heapify(struct cake_sched_data *q, u16 i)
>> +{
>> + static const u32 a = CAKE_MAX_TINS * CAKE_QUEUES;
>> + u32 m = i;
>> + u32 mb = cake_heap_get_backlog(q, m);
>
> Please order local variables from longest to shortest line.
>
> The entire submissions has this problem all over the place, please
> correct it patch-series wide.
Right-oh, one plantation of reverse christmas trees coming right up :)
-Toke
^ permalink raw reply
* Re: [PATCH] net: phy: micrel: workaround for errata #2 for KSZ9031
From: Uwe Kleine-König @ 2018-05-14 9:05 UTC (permalink / raw)
To: Marco Felsch
Cc: robh+dt, mark.rutland, andrew, f.fainelli, netdev, Markus Niebel,
kernel, devicetree
In-Reply-To: <20180514082218.29158-1-m.felsch@pengutronix.de>
Hello,
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index f41b224a9cdb..3e4243e4f7a7 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -528,6 +528,8 @@ static int ksz9031_enable_edpd(struct phy_device *phydev)
>
> static int ksz9031_config_init(struct phy_device *phydev)
> {
> + int rc;
> + u16 val;
These could be declared in more local scope.
> const struct device *dev = &phydev->mdio.dev;
> const struct device_node *of_node = dev->of_node;
> static const char *clk_skews[2] = {"rxc-skew-ps", "txc-skew-ps"};
> @@ -573,6 +575,22 @@ static int ksz9031_config_init(struct phy_device *phydev)
> ksz9031_of_load_skew_values(phydev, of_node,
> MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,
> tx_data_skews, 4);
> +
> + /* force master mode -> errata #2
> + * attention: Master <-> Master will not work
> + */
> + if (of_property_read_bool(of_node, "force-master")) {
> + rc = phy_read(phydev, MII_CTRL1000);
> + if (rc >= 0) {
> + val = (u16)rc;
> + /* enable master mode, config &
> + * prefer master
> + */
> + val |= (CTL1000_ENABLE_MASTER |
> + CTL1000_AS_MASTER);
> + phy_write(phydev, MII_CTRL1000, val);
There is no need for two variables, just use a single int variable that
on all Linux archs can hold the whole domain of u16 should be fine.
> + }
> + }
Maybe issue a warning if reading MII_CTRL1000 failed?
> }
>
> return ksz9031_center_flp_timing(phydev);
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* 答复: [PATCH] ipvlan: flush arp table when mac address changed
From: liuqifa @ 2018-05-14 8:49 UTC (permalink / raw)
To: Paolo Abeni, davem@davemloft.net, dsahern@gmail.com,
maheshb@google.com, weiyongjun (A), maowenan, Dingtianhong
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <1526283581.4411.2.camel@redhat.com>
Hi,
>
> Hi,
>
> On Sat, 2018-05-12 at 19:00 +0800, liuqifa@huawei.com wrote:
> > From: Keefe Liu <liuqifa@huawei.com>
> >
> > When master device's mac has been changed, the commit <32c10bbfe914>
> > "ipvlan: always use the current L2 addr of the master" makes the
> > IPVlan devices's mac changed also, but it doesn't flush the IPVlan's
> > arp table.
> >
> > Signed-off-by: Keefe Liu <liuqifa@huawei.com>
> > ---
> > drivers/net/ipvlan/ipvlan_main.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ipvlan/ipvlan_main.c
> > b/drivers/net/ipvlan/ipvlan_main.c
> > index 450eec2..a1edfe1 100644
> > --- a/drivers/net/ipvlan/ipvlan_main.c
> > +++ b/drivers/net/ipvlan/ipvlan_main.c
> > @@ -7,6 +7,8 @@
> > *
> > */
> >
> > +#include <net/neighbour.h>
> > +#include <net/arp.h>
> > #include "ipvlan.h"
> >
> > static unsigned int ipvlan_netid __read_mostly; @@ -792,8 +794,10 @@
> > static int ipvlan_device_event(struct notifier_block *unused,
> > break;
> >
> > case NETDEV_CHANGEADDR:
> > - list_for_each_entry(ipvlan, &port->ipvlans, pnode)
> > + list_for_each_entry(ipvlan, &port->ipvlans, pnode) {
> > ether_addr_copy(ipvlan->dev->dev_addr, dev-
> >dev_addr);
> > + neigh_changeaddr(&arp_tbl, ipvlan->dev);
> > + }
>
> Why don't using:
>
> call_netdevice_notifiers(NETDEV_CHANGEADDR, ipvlan->dev);
>
> instead?
>
> that is what other stacked device - bridge and vlans - are currently doing in
> the same scenario.
>
> Thanks,
>
> Paolo
>
Yes, I agre with you, this is a better solution.
Thanks
Keefe
^ permalink raw reply
* Re: [PATCH net] xfrm6: avoid potential infinite loop in _decode_session6()
From: Steffen Klassert @ 2018-05-14 8:41 UTC (permalink / raw)
To: David Miller; +Cc: edumazet, netdev, eric.dumazet, nicolas.dichtel
In-Reply-To: <20180513.202349.1985276646648462963.davem@davemloft.net>
On Sun, May 13, 2018 at 08:23:49PM -0400, David Miller wrote:
> From: Eric Dumazet <edumazet@google.com>
> Date: Sat, 12 May 2018 02:49:30 -0700
>
> > syzbot found a way to trigger an infinitie loop by overflowing
> > @offset variable that has been forced to use u16 for some very
> > obscure reason in the past.
> >
> > We probably want to look at NEXTHDR_FRAGMENT handling which looks
> > wrong, in a separate patch.
> >
> > In net-next, we shall try to use skb_header_pointer() instead of
> > pskb_may_pull().
> ...
> > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Cc: Steffen Klassert <steffen.klassert@secunet.com>
> > Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> > Reported-by: syzbot+0053c8...@syzkaller.appspotmail.com
>
> Steffen, I am assuming you will pick this up.
Yes, now applied to the ipsec tree.
Thanks a lot Eric!
^ permalink raw reply
* Re: [PATCH net-next v2 06/13] phy: add 2.5G SGMII mode to the phy_mode enum
From: Antoine Tenart @ 2018-05-14 8:37 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Antoine Tenart, davem, kishon, gregory.clement, andrew, jason,
sebastian.hesselbarth, netdev, linux-kernel, thomas.petazzoni,
maxime.chevallier, miquel.raynal, nadavh, stefanc, ymarkman, mw,
linux-arm-kernel
In-Reply-To: <20180508123408.GK16141@n2100.armlinux.org.uk>
Hi Russell,
On Tue, May 08, 2018 at 01:34:08PM +0100, Russell King - ARM Linux wrote:
> On Fri, May 04, 2018 at 03:56:36PM +0200, Antoine Tenart wrote:
> > This patch adds one more generic PHY mode to the phy_mode enum, to allow
> > configuring generic PHYs to the 2.5G SGMII mode by using the set_mode
> > callback.
> >
> > Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
> > Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
>
> Would it be possible to get the 2.5G SGMII comphy support merged
> ahead of the rest of this series please - I don't think there's been
> any objections to it, and having it in mainline would then mean I can
> drop the Marvell Comphy code from my tree and transition to the bootlin
> Comphy code instead.
>
> Of course, the perfect solution would be to get the whole series merged,
> but I'm just thinking about the situation where we're still discussing
> points when the next merge window opens.
That would be great, and there are no dependency issue if patches 6 and
7 are taken ahead.
Kishon: since there are no objection to these two phy patches, could you
take them?
Thanks!
Antoine
--
Antoine Ténart, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply
* [PATCH bpf-next v2] samples/bpf: xdp_monitor, accept short options
From: Prashant Bhole @ 2018-05-14 8:29 UTC (permalink / raw)
To: Daniel Borkmann, Alexei Starovoitov
Cc: Prashant Bhole, Jesper Dangaard Brouer, David S . Miller, netdev
Updated optstring parameter for getopt_long() to accept short options.
Also updated usage() function.
Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
---
samples/bpf/xdp_monitor_user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/bpf/xdp_monitor_user.c b/samples/bpf/xdp_monitor_user.c
index 894bc64c2cac..05ad3f590c91 100644
--- a/samples/bpf/xdp_monitor_user.c
+++ b/samples/bpf/xdp_monitor_user.c
@@ -58,7 +58,7 @@ static void usage(char *argv[])
printf(" flag (internal value:%d)",
*long_options[i].flag);
else
- printf("(internal short-option: -%c)",
+ printf("short-option: -%c",
long_options[i].val);
printf("\n");
}
@@ -594,7 +594,7 @@ int main(int argc, char **argv)
snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]);
/* Parse commands line args */
- while ((opt = getopt_long(argc, argv, "h",
+ while ((opt = getopt_long(argc, argv, "hDSs:",
long_options, &longindex)) != -1) {
switch (opt) {
case 'D':
--
2.13.6
^ permalink raw reply related
* Re: [PATCH bpf-next] samples/bpf: xdp_monitor, accept short options
From: Prashant Bhole @ 2018-05-14 8:28 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: Daniel Borkmann, Alexei Starovoitov, David S . Miller, netdev
In-Reply-To: <20180511183125.6b4f92e2@redhat.com>
On 5/12/2018 1:31 AM, Jesper Dangaard Brouer wrote:
> On Fri, 11 May 2018 10:37:51 +0900
> Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> wrote:
>
>> updated optstring accept short options
>>
>> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
>> ---
>> samples/bpf/xdp_monitor_user.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/samples/bpf/xdp_monitor_user.c b/samples/bpf/xdp_monitor_user.c
>> index 894bc64c2cac..668511c77aaf 100644
>> --- a/samples/bpf/xdp_monitor_user.c
>> +++ b/samples/bpf/xdp_monitor_user.c
>> @@ -594,7 +594,7 @@ int main(int argc, char **argv)
>> snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]);
>>
>> /* Parse commands line args */
>> - while ((opt = getopt_long(argc, argv, "h",
>> + while ((opt = getopt_long(argc, argv, "hDSs:",
>> long_options, &longindex)) != -1) {
>> switch (opt) {
>> case 'D':
>
> It was actually on purpose that I didn't add the short options,
> in-order to force people use those "self-documenting" long-options when
> they show the usage on public mailing lists or in blog-posts.
Got it.
>
> If you want these short options, you also have to correct the "usage"
> function that state these are "internal" short-options.
I am submitting v2 with "usage" updated, because with usability point of
view it is nice to have short options. Thanks.
-Prashant
>
> Notice the long options parsing done by getopt_long() allow you to only
> specify part of the string. Al-through, I can see --s is ambiguous.
>
> $ sudo ./xdp_monitor --s
> ./xdp_monitor: option '--s' is ambiguous; possibilities: '--stats' '--sec'
^ permalink raw reply
* [PATCH] net: phy: micrel: workaround for errata #2 for KSZ9031
From: Marco Felsch @ 2018-05-14 8:22 UTC (permalink / raw)
To: robh+dt, mark.rutland, andrew, f.fainelli
Cc: netdev, devicetree, kernel, Markus Niebel
From: Markus Niebel <Markus.Niebel@tqs.de>
handle errata #2 for KSZ9031: force 1000Base-T master
Attention: enabling the workaround will cause no link to
other GIGE master.
Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
[m.felsch@pengutronix.de: move dt binding to the KSZ9031 entry]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
.../devicetree/bindings/net/micrel-ksz90x1.txt | 3 +++
drivers/net/phy/micrel.c | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt b/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt
index 42a248301615..e2465fbbbcef 100644
--- a/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt
+++ b/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt
@@ -57,6 +57,9 @@ KSZ9031:
- txd2-skew-ps : Skew control of TX data 2 pad
- txd3-skew-ps : Skew control of TX data 3 pad
+ - force-master: Boolean, force phy to master mode. This is a
+ workaround at least for KSZ9031 errata #2.
+
Examples:
mdio {
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index f41b224a9cdb..3e4243e4f7a7 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -528,6 +528,8 @@ static int ksz9031_enable_edpd(struct phy_device *phydev)
static int ksz9031_config_init(struct phy_device *phydev)
{
+ int rc;
+ u16 val;
const struct device *dev = &phydev->mdio.dev;
const struct device_node *of_node = dev->of_node;
static const char *clk_skews[2] = {"rxc-skew-ps", "txc-skew-ps"};
@@ -573,6 +575,22 @@ static int ksz9031_config_init(struct phy_device *phydev)
ksz9031_of_load_skew_values(phydev, of_node,
MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,
tx_data_skews, 4);
+
+ /* force master mode -> errata #2
+ * attention: Master <-> Master will not work
+ */
+ if (of_property_read_bool(of_node, "force-master")) {
+ rc = phy_read(phydev, MII_CTRL1000);
+ if (rc >= 0) {
+ val = (u16)rc;
+ /* enable master mode, config &
+ * prefer master
+ */
+ val |= (CTL1000_ENABLE_MASTER |
+ CTL1000_AS_MASTER);
+ phy_write(phydev, MII_CTRL1000, val);
+ }
+ }
}
return ksz9031_center_flp_timing(phydev);
--
2.17.0
^ permalink raw reply related
* (unknown),
From: системы администратор @ 2018-05-14 6:33 UTC (permalink / raw)
пользователь веб-почты
Обратите внимание, что 95% ваших писем, полученных после обновления сервера веб-почты в последнее время в нашей базе данных, были отложены. Регулярно получать и отправлять свои сообщения. Техническая команда нашей веб-почты обновит вашу учетную запись в течение 3 рабочих дней. Если вы этого не сделаете, ваша учетная запись будет временно приостановлена нашими службами. Чтобы повторно подтвердить свой почтовый ящик, пришлите следующую информацию:
обычный:
Имя пользователя:
пароль:
Подтвердите Пароль:
Предупреждение!! Если это не позволит обновлять учетные записи в
течение двух дней после получения электронной почты, они будут
постоянно потерять учетные записи владельцев учетных записей
веб-почты.
Спасибо за ваше сотрудничество!
Copyright © 2017-2018 Служба технической поддержки WebMail, Inc.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox